#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here types.sort() cnt = types.copy() for x in range(n): cnt[x] = 0 for x in range(n): cnt[types[x]-1] += 1 mostCommon = cnt[0] mostCommonType = 1 for x in range(n-1): if cnt[x+1] > mostCommon: mostCommon = cnt[x+1] mostCommonType = x+2 print(mostCommonType)