#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here birds = {} for i in range(len(types)): key = types[i] if key in birds: birds[key] += 1 else: birds[key] = 1 #print (birds) print (max(birds, key=birds.get))