You are given $N$ positive integers $X_1, X_2, \ldots, X_N$. Write a program that finds the smallest value that appears at least as many times as every other number in the sequence (that is, a value whose frequency is maximal).
In other words, among all values that share the maximum frequency, output the smallest one.
The first line contains a single integer $N$. Each of the next $N$ lines contains one integer $X_i$ (for $i = 1, 2, \ldots, N$).
Print a single integer: the smallest value that appears at least as many times as any other number. Equivalently, if several values share the maximum frequency, print the smallest of them.