DMOPC '15 Contest 1 P1 - Itami and Manga

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type

Itami finally made it to the manga convention! There are N mangas that Itami would like to buy. However, his job in the army doesn't earn him a whole lot, so he only has enough money for one. Knowing this, it shouldn't come as a surprise that he wants to buy the best one.

Itami has a list of the mangas he wants to buy and their respective ratings from online sources. Unfortunately, due to unforeseen circumstances, he has no time to look through his long list. Help Itami figure out which manga he should buy.

Input Specification

The first line of input will contain N (1 \le N \le 100), the number of mangas Itami is considering.

The next N lines will contain string S_i, the name of the i-th manga and R_i (0.00 \le R_i \le 10.00), its rating with up to 2 decimal places. It is guaranteed that manga names will contain no more than 25 lowercase letters and that all names and ratings are distinct.

Output Specification

The only line of output should contain string B, the name of the best manga in Itami's list.

Sample Input

4
naruto 7.79
bleach 7.97
onepiece 8.62
gate 10

Sample Output

gate

Comments

There are no comments at the moment.