#C10205. Top Performer

    ID: 39385 Type: Default 1000ms 256MiB

Top Performer

Top Performer

This problem requires you to determine the employee with the highest sales count from a list of sales records. Each record contains an employee's name and the number of sales they made. In the event of a tie (i.e. when several employees have equal sales), the employee who appears first in the input with the maximum sales should be selected.

The process can be formally described as finding an employee name such that for a list of records \(\{(name_i, sales_i)\}\), if \(sales_k = \max(sales_i)\) for some \(k\), output name_k, where if there is another \(j < k\) with \(sales_j = sales_k\), then output name_j.

inputFormat

The input is provided via standard input (stdin). The first line contains an integer \(N\) indicating the number of sales records. Each of the following \(N\) lines contains an employee's name (a string without spaces) and an integer representing the sales count, separated by a space.

outputFormat

Output to standard output (stdout) the name of the employee with the highest sales count. If there are multiple employees with the highest sales, output the one that appears first in the input. If the input list is empty (i.e. \(N = 0\)), output None.

## sample
1
Alice 50
Alice