This page is still under construction.

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

Finding the Easiest Problem

Interview

Time limit1sMemory limit1024 MB

Summary
Read N titles with distinct difficulties and print the title whose difficulty is the smallest.
Level

Easy1 of 10

Topics
Implementation, Array
Solved
No attempts yet

Problem

If you reviewed the preliminary round problems carefully, you noticed that the 5 problems from the preliminary round are sorted in order of difficulty.

The final round, however, sorts problems by title in lexicographic order, so the problems may not be sorted in order of difficulty.

Given problem titles and difficulties, write a program that prints the title of the easiest problem.

A problem's difficulty is expressed as a natural number, and a larger number means a harder problem.

Input

The first line gives the number of problems NN.

Each of the next NN lines gives a problem title and its difficulty, separated by a space.

Output

Print the title of the easiest problem.

Constraints

  • 1≤N≤41 \leq N \leq 4
  • A problem title consists only of uppercase English letters.
  • A problem title is at most 10 characters long, and all problem titles are distinct.
  • A problem's difficulty is a natural number from 1 to 4, and all difficulties are distinct.
  • The problems are given in lexicographic order of their titles.

Examples1

  1. Example 1

    Input
    3
    ABCDE 4
    BCDEF 2
    CDEFG 3
    
    Expected output
    BCDEF