TTC '18 Contest 1 P2 - Laptop Quality

View as PDF

Submit solution

Points: 5
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

jsumabat loves to stare at computers. Especially Mac computers, with their beautiful touch bars.

He is given N named computers, each with a rating quality from 1 to 10. jsumabat wants to find out which computer has the best rating quality, and has asked you to write a program to help him!

If there are multiple computers with the highest rating quality, choose the one that you encountered last.

Input Specifications

The first line will contain an integer N (1 \le N \le 100).

The next N lines will contain a single world S followed by an integer q_i (1 \le q_i \le 10), the name of the computer and the rating quality respectively.

Output Specifications

The output should contain only 1 string, the name of the computer with the best rating quality.

Sample Input 1

4
Zoidberg 5
Ned 4
iBook 9
Buttons 2

Sample Output 1

iBook

Comments

There are no comments at the moment.