1176: 众数

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:38 Solved:18

Description

对于一个长度为n的序列{an}来说,其众数被定义为出现次数最多的数。
现在给定的给一个长度为n的序列,请求出它的众数是多少。
如果有多个众数,请输出最小的一个。

Input

第一行一个数字n,1 <= n <= 106, 0 < ai < 1000
第二行n个数

Output

输出众数

Sample Input Copy

6
3 5 7 5 3 1

Sample Output Copy

3

Source/Category