i=input i() L=i().split() print(max(sorted(set(L))[::-1],key=L.count))