#include #include using namespace std; int main(){ int n; cin >> n; map types; for(int types_i = 0; types_i < n; types_i++){ int temp; cin >> temp; types[temp]++; } // your code goes here int max = 0; int min_id = 6; for (auto it = types.begin(); it != types.end(); it++) { if ((it->second > max) || (it->second == max && it->first < min_id)) { max = it->second; min_id = it->first; } } cout << min_id << endl; return 0; }