Key with Maximum Value


Submit solution

Points: 10
Time limit: 2.0s
Memory limit: 256M

Author:
Problem types

A student dictionary stores each student name and score. Find the student with the highest score. If several students tie, choose the one appearing first in the input.</p>

Input

The first line contains n (1 ≤ n ≤ 500000). The second line contains n space-separated name:score pairs with distinct names and integer scores |score| ≤ 10^9.

Output

Print the selected key and its value.

Examples

Input #1
3
An:7 Binh:9 Chi:8
Output #1
Binh 9

Explanation #1: Binh has score 9, which is greater than the scores of An and Chi.

Input #2
3
first:7 second:7 third:2
Output #2
first 7

Explanation #2: first and second tie at 7, so the name appearing first is selected.


Comments

There are no comments at the moment.