#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <map>
#include <stack>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <cstdio>
#include <iomanip>
#define F first
#define S second
#define ll long long
#define len length()
#define sqr(x) x*x
#define pb push_back
#define mp make_pair
#define sz(x) ((int) (x).size())
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define bp(x) __builtin_popcount(x)
#define INF numeric_limits<long long int>::max()
#define sync ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define frp freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define forit(it, s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it++)
const int maxn = ( int ) 1e6 ;
const int mod = ( int ) 1e9 + 7 ;
using namespace std;
int n;
__int64 mx= - 1 ,ans,x;
map< ll,ll> m;
int main( ) {
ios_base:: sync_with_stdio ( 0 ) ;
scanf ( "%d" ,& n) ;
for ( int i= 0 ; i < n; i++ ) {
scanf ( "%I64d" ,& x) ;
m[ x] ++ ;
}
for ( map< ll,ll> :: iterator it= m.begin ( ) ; it ! = m.end ( ) ; it++ ) {
if ( ( * it) .S > mx) {
mx= ( * it) .S ;
ans= ( * it) .F ;
}
}
printf ( "%I64d\n " ,ans) ;
return 0 ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8c2V0PgojaW5jbHVkZSA8cXVldWU+CiNpbmNsdWRlIDxtYXA+CiNpbmNsdWRlIDxzdGFjaz4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGNzdHJpbmc+CiNpbmNsdWRlIDxjbWF0aD4KI2luY2x1ZGUgPGNzdGRsaWI+CiNpbmNsdWRlIDxjc3RkaW8+CiNpbmNsdWRlIDxpb21hbmlwPgoKI2RlZmluZSBGIGZpcnN0CiNkZWZpbmUgUyBzZWNvbmQKI2RlZmluZS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XRvciBpdD1tLmJlZ2luKCk7IGl0ICE9IG0uZW5kKCk7IGl0KyspewoJCWlmKCgqaXQpLlMgPiBteCl7CgkJCW14PSgqaXQpLlM7CgkJCWFucz0oKml0KS5GOwoJCX0JCgl9CglwcmludGYoIiVJNjRkXG4iLGFucyk7CQogICAKICAgIHJldHVybiAwOwp9
compilation info
prog.cpp:37:1: error: '__int64' does not name a type
__int64 mx=-1,ans,x;
^
prog.cpp: In function 'int main()':
prog.cpp:44:18: error: 'x' was not declared in this scope
scanf("%I64d",&x);
^
prog.cpp:48:16: error: 'mx' was not declared in this scope
if((*it).S > mx){
^
prog.cpp:50:4: error: 'ans' was not declared in this scope
ans=(*it).F;
^
prog.cpp:53:19: error: 'ans' was not declared in this scope
printf("%I64d\n",ans);
^
stdout