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