#include<iostream>
#include<map>
using namespace std;
int main()
{
int n;
cin>>n;
int a;
map<int, int> num;
map<int, int>::iterator p;
for (int i = 0;i < n; i++){
cin>>a;
num[a]++;
}
int m=0,s;
for (p=num.begin();p!=num.end(); p++)
if(p->second>m) s=p->first;
cout<<s;
return 0;
}
用桶,输入一个加一个,最后一循环从1查到10000即可