import collections n=int(input()) l=list(map(int,input().split())) c=collections.Counter(l).most_common() maxi = 0 maxj = 0 for i,j in c: if maxj <= j: maxj = j if maxi < i: maxi = i print(maxi)