#include #define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false)) #define precise(i) fixed << setprecision(i) #define rep(i, n) for (int i = 0; i < (int)(n); i++) using namespace std; int main() { fastIO; int l; cin >> l; vector antiquet(l, 0); rep(_, l) { int n; cin >> n; antiquet[n - 1]++; } int maxv = 0, idx = 0; for (size_t i = 0; i < antiquet.size(); ++i) { if (maxv <= antiquet[i]) { maxv = antiquet[i]; idx = i; } } cout << idx + 1 << '\n'; }