Problem Description

Read n pairs key value (integer). Compute the key with maximum value. If tie, pick lexicographically smallest key. Output the key.

Input Format

First line n. Next n lines: key value.

Output Format

One key.

Sample Test Case

Input:
4 a 5 b 9 c 9 aa 9
Output:
aa

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next