This page is still under construction.

Parts of this page are still being built. What you see may change.

The Tallest Student

Time limit1sMemory limit256 MB

Summary
Print the name of the tallest student in each test case, listing every tied name in input order.
Level

Easy1 of 10

Topics
Implementation
Solved
No attempts yet

Problem

Minwoo has been competitive since his school days. When the class runs, he wants to know who is fastest, and when the class takes an exam, he wants to know who scored highest. The class just measured everyone's height, so now Minwoo wants to know who is tallest. Help him find the tallest student.

Input

The input holds several test cases.

The first line of each test case has the number of students NN (0<N≤500 < N \le 50). Each of the next NN lines has one student's name and height, separated by a single space. A name uses uppercase and lowercase letters only and is at most 10 characters long. A height is given with exactly two digits after the decimal point.

When NN is 0, the input is over and the program stops.

Output

For each test case, print the name of the tallest student on one line. If several students share the greatest height, print all of them. Separate the names with a single space and keep the order in which they appear in the input.

Examples3

  1. Example 1

    Input
    3
    John 1.75
    Mary 1.64
    Sam 1.81
    2
    Jose 1.62
    Miguel 1.58
    5
    John 1.75
    Mary 1.75
    Sam 1.74
    Jose 1.75
    Miguel 1.75
    0
    
    Expected output
    Sam
    Jose
    John Mary Jose Miguel
    
  2. Example 2

    Input
    1
    Ada 1.60
    0
    
    Expected output
    Ada
    
  3. Example 3

    Input
    4
    ann 1.70
    Bob 1.70
    Cid 1.70
    Dee 1.70
    0
    
    Expected output
    ann Bob Cid Dee