#include #include #include #include #include int main() { const int NUM_TYPES = 5; int num_birds; std::cin >> num_birds; int frequency_count[NUM_TYPES]; std::fill(std::begin(frequency_count), std::end(frequency_count), 0); for(int i = 0; i < num_birds; ++i) { int curr_bird_type; std::cin >> curr_bird_type; ++frequency_count[curr_bird_type - 1]; } int most_common_type = NUM_TYPES; for(int curr_type = NUM_TYPES - 1; curr_type >= 1; --curr_type) { if(frequency_count[curr_type - 1] >= frequency_count[most_common_type - 1]) { most_common_type = curr_type; } } std::cout << most_common_type << std::endl; return 0; }