5357: 【60课】【3348】众数

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:35 Solved:27

Description

对于一个长度为 n 的序列 {an} 来说,其众数被定义为出现次数最多的数。

现在给定一个长度为 n 的序列,请帮忙求出它的众数是多少。

当然众数可能有多个,你只需要输出最小的一个就可以了。

Input

第一行输入 n,第二行输入 n 个数,n<106,0≤ai≤1000

Output

输出众数。

Sample Input Copy

6
3 5 7 5 3 1

Sample Output Copy

3