#!/bin/python3 import sys from collections import defaultdict n = int(input().strip()) types = list(map(int, input().strip().split(' '))) count = defaultdict(int) for type in types: count[type] += 1 print(max(count, key=count.get))