#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here c = {} for x in types: if x in c.keys(): c[x]+=1 else: c[x] = 1 m = max(c.values()) for x in c.keys(): if c[x] == m: print(x) break