# coding=UTF-8; import collections; n = int(input()) levelList = list(map(int, input().split())) listCount = collections.Counter(levelList) sortList = listCount.most_common() sortList.sort(key=lambda x:x[1],reverse=True) print(sortList[0][0])