All problems

Setting a Default Palette Globally

mediumPythonSeabornset_palette

Marlow & Finch set a client's colour set once at the top of the build script, so every chart in the report picks its colours from the same place without anyone repeating themselves. The report's opening sentence is written from the data rather than from the chart: it names the category that scored highest.

Task: Print the name of the category with the highest value.

Input

The first line holds one integer n, the number of records, where 1 <= n <= 1000. Then come n lines, each holding a category name and a value separated by a single space. Category names contain no spaces.

Output

One line holding the category name, spelled exactly as it appears in the input. If two records tie for the highest value, print the one that appeared first in the input.

Example:

Input:
3
A 10
B 30
C 20

Output:
B

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…