x = input()
list1 = [int(e) for e in input().split()]
list2 = [0] * (int(max(list1)) + 1)
for i in list1:
    list2[i] += 1
answer = list2.index(max(list2))
print(answer)

ecae7b3e5c8a6d0ac11b35b90a24fe0a25a73a7e
<mask token>

<mask token>
for i in list1:
    list2[i] += 1
<mask token>
print(answer)

x = input()
list1 = [int(e) for e in input().split()]
list2 = [0] * (int(max(list1)) + 1)
for i in list1:
    list2[i] += 1
answer = list2.index(max(list2))
print(answer)
