#pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include using namespace std; typedef unsigned long long ull; typedef long long ll; typedef long double ld; typedef pair p32; typedef pair p64; typedef pair pdd; typedef vector v64; typedef vector v32; typedef vector > vv32; typedef vector > vv64; typedef vector > vvp64; typedef vector vp64; typedef vector vp32; typedef vector vb; typedef vector > vbb; //ll MOD = 1e9+7; double eps = 1e-12; #define forn(i,e) for(int i = 0; i < e; i++) #define forsn(i,s,e) for(ll i = s; i < e; i++) #define rforn(i,s) for(ll i = s; i >= 0; i--) #define rforsn(i,s,e) for(ll i = s; i >= e; i--) #define ln "\n" #define dbg(x) cout<<#x<<" = "< void setIO(string s) { // the argument is the filename without the extension freopen((s+".in").c_str(),"r",stdin); freopen((s+".out").c_str(),"w",stdout); } int main(){ int n; cin>>n; v32 x(6); vp32 y; forn(i,n){ int a; cin>>a; a--; x[a]++; } forn(i,6){ y.pb(mp(x[i],i+1)); } sort(all(y)); int lev = y[5].se; int maxv = y[5].fi; int i=4; while(i>=0 && y[i].fi==maxv){ if(y[i].se > lev) lev = y[i].se; i--; } cout<