#C363. Find Passenger with the Highest Points
Find Passenger with the Highest Points
Find Passenger with the Highest Points
You are given a series of transactions that record the score changes for a number of passengers. Each transaction consists of a passenger's name and an integer representing the score change. After processing all transactions, the final score of each passenger is calculated.
If there is a tie for the highest final score among several passengers, the winner is determined by the order in which a passenger first reached or exceeded this highest score during the transaction sequence. In other words, simulate the transactions in order and the first passenger whose running total reaches at least the winning final score (and whose final score is exactly that value) is declared the winner.
Your task is to determine and output the name of the winning passenger.
inputFormat
The first line of input contains an integer t representing the number of transactions. Each of the next t lines contains a passenger name (a string without spaces) and an integer indicating the score change, separated by a space.
outputFormat
Output a single line with the name of the passenger with the highest final score. In case of a tie, output the passenger who reached the winning score first.
## sample5
alice 10
bob 20
alice -5
bob 10
charlie 15
bob
</p>