Key with Maximum Value
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:8Output #1
Binh 9Explanation #1: Binh has score 9, which is greater than the scores of An and Chi.
Input #2
3
first:7 second:7 third:2Output #2
first 7Explanation #2: first and second tie at 7, so the name appearing first is selected.
Comments