#define _USE_MATH_DEFINES //M_PI #include //std::cout, std::cin #include //std::string #include //std::vector #include //std::valarray 数値のみの一次配列 #include //std::sort #include //localtime_s #include //abs #include //abs, std::pow, sqrt, sin, cos, #include //std::ifstream #include //std::setprecision #include //std::random(C++11) #include //std::accumulate int main(void) { //test用 //std::ifstream in("test.txt"); //std::cin.rdbuf(in.rdbuf()); int N; std::cin >> N; std::vector sum(6); int temp = 0; for (int i = 0; i < N; i++) { std::cin >> temp; sum[temp - 1]++; } int max = *std::max_element(sum.begin(), sum.end()); int maxidx = 0; for (int i = 0; i < 6; i++) { if (sum[i] >= max) { maxidx = i; } } std::cout << maxidx + 1 << std::endl; }