#C9174. Most Popular Candidate

    ID: 53238 Type: Default 1000ms 256MiB

Most Popular Candidate

In a faraway kingdom, an election is held where each vote is represented by a pair of integers. The first integer is the voter identifier and the second is the candidate identifier. The task is to determine the most popular candidate who receives the highest number of votes. In case of a tie, the candidate with the smaller numerical identifier is chosen, i.e., if two candidates receive the same number of votes, the winner is given by $$\min(candidate)$$.

inputFormat

The first line of input contains an integer n which represents the total number of votes. Each of the following n lines contains two space-separated integers: the first number is the voter identifier (which is not used for the counting) and the second is the candidate identifier.

outputFormat

Output a single line with two space-separated integers: the identifier of the most popular candidate and the number of votes they received.

## sample
5
1 3
2 3
3 4
4 3
5 4
3 3