N=int(input()) L=list(map(int,input().split())) count=[0,0,0,0,0,0] temp=0 for i in L: count[i-1]+=1 for i in range(6): if(count[i]>temp): temp=count[i] for i in reversed(range(6)): if(count[i]==temp): print(i+1) break