#include #include using namespace std; int main(void) { int n, l; cin >> n; vector poll(n + 1, 0); for (int i = 0; i < n; ++i) { cin >> l; ++poll[l]; } int maxl = -1, ans = 0; for (int i = 0; i < n + 1; ++i) { if (poll[i] >= maxl) { ans = i; maxl = poll[i]; } } cout << ans << endl; return 0; }