#include using namespace std; int main() { int hashMap[6]; for(int i = 0; i < 6; i++) hashMap[i] = 0; int n, b; cin >> n; while(n--){ cin >> b; hashMap[b]++; } int maxelem = 1; int max = hashMap[1]; for(int i = 2; i < 6; i++) { //cout << i << ": " << hashMap[i] << endl; //cout << "max: " << max <<" maxelem: " << maxelem << endl; if(max < hashMap[i]){ maxelem = i; max = hashMap[i]; } } cout << maxelem << endl; }