#include using namespace std; int main(){ int n,tmp,ans; cin >> n; map m; for(int types_i = 0; types_i < n; types_i++){ cin >> tmp; m[tmp]++; } ans = tmp = -1; for(map::iterator it = m.begin(); it != m.end(); ++it) { if(it->second > tmp) { ans = it->first; tmp = it->second; } } cout << ans << endl; return 0; }