#!/bin/python import sys n = int(raw_input().strip()) types = map(int, raw_input().strip().split(' ')) # your code goes here mydict = {} for i in types: if i in mydict.keys(): mydict[i] += 1 else: mydict[i] = 1 max = -1 number = 0 for n in mydict.keys(): if mydict[n] > number: max = n number = mydict[n] print max