#include #include #include #include using namespace std; int main() { int n; cin >> n; deque types(n); deque > count(7); for (int i = 1;i <= 5 ; i++) { count[i] = make_pair(0, i); } for (int& i : types){ cin >> i; count[i].first++; } stable_sort(count.begin(), count.end(), [] (auto a ,auto b){ return a.first > b.first; }); cout << count.front().second << endl; }