#include #include #include using namespace std; int MostCommonBird(const std::vector& types) { // insert the birds into a map to act as a frequency table std::map birds; for(unsigned i = 0; i < types.size();++i) birds[types[i]]++; int largest = 0; std::map::const_iterator val = birds.begin(); for(std::map::const_iterator it = birds.begin(); it != birds.end(); ++it) { if(it->second > largest){ largest = it->second; val = it; } } return val->first; } int main(){ int n; cin >> n; vector types(n); for(int types_i = 0; types_i < n; types_i++){ cin >> types[types_i]; } // your code goes here std::cout << MostCommonBird(types) << std::endl; return 0; }