#C13602. Top Students

    ID: 43159 Type: Default 1000ms 256MiB

Top Students

Top Students

You are given a list of students along with their grades. Your task is to determine the student(s) with the highest grade. If there are multiple students with the highest grade, output their names in alphabetical order separated by a single space. If no student exists (i.e. the list is empty), output nothing.

Note: Each student's name is unique and grades are non-negative integers.

inputFormat

The input is read from standard input (stdin) and has the following format:

  • The first line contains a single integer N which represents the number of students.
  • The next N lines each contain a student's name and an integer grade separated by a space.

If N is 0, it means there is no student data.

outputFormat

Output a single line to standard output (stdout) containing the names of the student(s) with the highest grade in alphabetical order, separated by a single space. If there is no student, output nothing.

## sample
3
Alice 88
Bob 90
Charlie 85
Bob

</p>