#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); //freopen("in.txt","r",stdin); int n; cin>>n; map<int,int>M; int ans=0; for(int i=1; i<=n; i++) { int x; cin>>x; M[x]++; ans=max(ans,M[x]); } for(auto j:M) if(j.second==ans) { cout<<j.first<<endl; break; } return 0; }