#include using namespace std; int main(){ int n; cin >> n; vector types(n); for(int types_i = 0; types_i < n; types_i++){ cin >> types[types_i]; } map m; for(int i = 0;i < n;i++) { if (m.find(types[i]) == m.end()) m.insert(pair(types[i], 1)); else m[types[i]]++; } map::iterator it; pair p(0,0); for(it = m.begin();it != m.end();it++) { if (it->second > p.second) { p.first = it->first; p.second = it->second; } else if (it->second == p.second && p.first > it->first) { p.first = it->first; p.second = it->second; } } cout<