Silent Auction | 프로그래밍의 벗 PivotOJ
PivotOJ

Silent Auction

시간 제한: 1000ms메모리 제한: 1024MB출처: CCC 2021 JuniorBOJ 21613

문제

A charity is having a silent auction where people place bids on a prize without knowing anyone else’s bid. Each bid includes a person’s name and the amount of their bid. After the silent auction is over, the winner is the person who has placed the highest bid. If there is a tie, the person whose bid was placed first wins. Your job is to determine the winner of the silent auction.

입력

The first line of input contains a positive integer N, where 1 ≤ N ≤ 100, representing the number of bids collected at the silent auction. Each of the next N pairs of lines contains a person’s name on one line, and the amount of their bid, in dollars, on the next line. Each bid is a positive integer less than 2000. The order of the input is the order in which bids were placed.

출력

Output the name of the person who has won the silent auction.

예제

예제 1

입력
3
Ahmed
300
Suzanne
500
Ivona
450
출력
Suzanne

예제 2

입력
2
Ijeoma
20
Goor
20
출력
Ijeoma
코드를 제출하려면 로그인하세요.