#include #include #include #include using namespace std; int main(){ int n,maxv=0,memo; cin >> n; vector a(n); vector b(7); for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) { b[a[i]]++; } for (int i = 1; i < 7; i++) { if (max(maxv, b[i]) == b[i]) { memo = i; maxv = b[i]; }else if (maxv == b[i]) { memo = i; } } cout << memo << endl; return 0; }