#include <bits/stdc++.h>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> types(n);
    map<int,int> m;
    int cant[5];
    for(int i=0; i<5;i++)cant[i]=0;
    int ma=0;
    for(int types_i = 0; types_i < n; types_i++){
       cin >> types[types_i];
        cant[types[types_i]-1]++;
        ma=max(ma, cant[types[types_i]-1]);
    }
    for(int i=0; i<5;i++){
        if(cant[i]==ma){
            cout<<i+1<<endl;
            return 0;
        }
    }
    
    // your code goes here
    return 0;
}