n=int(input()) l=list(map(int,input().split())) mxcnt=0 ans=0 for i in range(1,7): cnt=l.count(i) if cnt>=mxcnt: mxcnt=cnt ans=i print(ans)