#!/bin/python3 import sys def migratory_birds(a): """Return the most viewed bird based on type sightings.""" count = [0]*max(a) for i in a: count[i-1] += 1 return count.index(max(count))+1 n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here print(migratory_birds(types))