All problems

Two Pies, Side by Side (Before/After)

hardPythonMatplotlibSubplots

Calder & Voss is presenting a client's budget before a restructure and after it, as two circles side by side. A circle shows composition, and two of them let a reader compare one composition against another — but they cannot show change, because a department whose budget never moved still looks different once its neighbours have grown. The caption is where the actual movement gets named.

Task: Print the name of the category that rose the most, where a category's rise is its after value minus its before value. Rises are compared in plain units, not as proportions of what the category started with. If two or more categories tie for the biggest rise, print whichever appears earliest in the list. A category that fell has a negative rise, and if everything fell or stood still the answer is whichever of those numbers is largest.

Input

The first line holds an integer n, the number of categories. Each of the next n lines holds three fields separated by single spaces: the category name, one word with no spaces, then its before value and its after value. n is at least 1.

Output

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

Example:

Input:
3
Eng 40 30
Sales 30 30
Mkt 30 40

Output:
Mkt

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…