input() L=input().split() M=0 for i in range(1,7): C=L.count(str(i)) if M<=C: M=C O=i print(O)