input() s = list(map(int, input().split())) a, b = 0, 0 for i in range(10): aa = s.count(i) if a <= aa: a = aa b = i print(b)