#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here arr =[0 for i in range(len(types))] for i in types: arr[i] += 1 print(arr.index(max(arr)))