#include using namespace std; int num[200005]; int main() { ios::sync_with_stdio(0); int n, tmp, ans = -1; cin >> n; for (int i=0; i> tmp; num[tmp]++; } tmp = -1; for (int i=0; i tmp) { tmp = num[i]; ans = i; } } cout << ans << '\n'; }