#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here birds = {t: 0 for t in types} highest = 0 highest_bird = 0 for t in types: birds[t] += 1 for bird in birds.items(): if bird[1] > highest: highest = bird[1] highest_bird = bird[0] print(highest_bird)