from collections import Counter N = int(input()) L = list(map(int, input().split())) ans = Counter(L).most_common(1)[0][0] print(ans)