Multiple Lines With hue
Halden Cycle Hire runs several hire routes side by side, and each route files its own daily figure. The dashboard draws one coloured line per route so they can be compared at a glance. The Monday review is narrower than that: it only asks which route was on top on day 3, and it wants the name in writing rather than a colour to squint at.
Task: Print the name of the route with the highest value recorded on day 3.
Input
The first line holds one integer n, the number of readings, where 1 <= n <= 1000. Then come n lines, each holding a day number, a route name and a value, separated by single spaces. Route names contain no spaces. At least one reading is for day 3, and on day 3 no two routes share the top value.
Output
One line holding the route name, spelled exactly as it appears in the input.
Example:
Input:
4
1 A 10
3 A 50
1 B 20
3 B 80
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