#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here birds = {} for t in types: a = birds.get(t) if a is None: birds[t] = 1 else: birds[t] = birds[t]+1 maxb = 0 value = 0 for b,v in birds.items(): if v > maxb: maxb=v value = b print(value)