#coding=UTF-8 N=int(input()) mojir=input() hyo=mojir.split(' ') L=[int(mono) for mono in hyo] hindo=[0]*6 for myon in L: hindo[myon-1]=hindo[myon-1]+1 ans=0 ansde=0 for idx in range(0,6,1): if hindo[idx]>=ansde: ans=idx ansde=hindo[idx] print(ans+1)