#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here counts = {} for t in types: if t in counts: counts[t] += 1 else: counts[t] = 1 most_birds = None most_birds_val = 0 for key in counts: if counts[key] > most_birds_val: most_birds_val = counts[key] most_birds = key print(most_birds)