All problems

Market Share as a Pie Chart

easyPythonMatplotlibPie Chart

Calder & Voss reports market share for a drinks brand. The picture is a circle cut into wedges, one per company, with each wedge's angle set by that company's share — a shape that only tells the truth because the companies listed between them account for the entire market. The client's briefing note opens by naming the leader, so that name has to be printed under the picture.

Task: Print the name of the company holding the largest share. If two or more companies are tied on the largest share, print whichever of them appears earliest in the list.

Input

The first line holds an integer n, the number of companies. Each of the next n lines holds two fields separated by a single space: the company name, one word with no spaces in it, then its share. Shares may have decimals. n is at least 1.

Output

One line holding the company name, spelled exactly as it appeared.

Example:

Input:
3
Alpha 40
Beta 35
Gamma 25

Output:
Alpha

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…