Favorite game#7402

Favorite game

1 second
128 megabytes
Very easy

During his life, Stepan played a lot of games. One day, he decided to find out which game he liked the most. For this, he decided to count the total time spent on each game. The one for which he had spent the greatest amount of time is his favorite.

Fortunately, Stepan has his daily diary, where he records the number of minutes spent on each game. Therefore, it is not difficult to find a game in which he played the most time in total. For simplicity, Stepan numbered all the games with integers.

It is guaranteed that Stepan has only one favorite game.

Input

The first line contains the number of records (1 \leq n \leq 1000) in Stepan's diary. Each of the next lines contain one record - the pair of numbers x_i, y_i showing that Stepan played game x_i for exactly y_i minutes (1 \leq x_i, y_i \leq 1000).

Output

Print one number - the number of Stepan's favorite game.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Example 3

Loading
Loading