n=int(input()) ls=[int(i) for i in input().split()] cls=[] maxls=[] for i in range(1,n+3): cls.append(ls.count(i)) for index,value in enumerate(cls): if value==max(cls): maxls.append(index+1) print(max(maxls))