#!/bin/python3 import sys import collections n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here print(collections.Counter(types).most_common(1)[0][0])