#include #define For(i, a, b) for(long long i = a; i < b; i++) #define rep(i, n) For(i, 0, n) #define rFor(i, a, b) for(long long i = a; i >= b; i--) #define ALL(v) (v).begin(), (v).end() #define rALL(v) (v).rbegin(), (v).rend() using namespace std; using lint = long long; using ld = long double; int main() { int n; cin >> n; vector cnt(10); rep(i, n) { int l; cin >> l; cnt[l]++; } int mx = *max_element(ALL(cnt)); rFor(i, 9, 0) { if (cnt[i] == mx) { cout << i << endl; return 0; } } }