#!/bin/python import sys n = int(raw_input().strip()) types_list = map(int, raw_input().strip().split(' ')) # Ready my type array type_arr = [] for item in xrange(n): type_arr.append(0) #Add the total to type_arr for item in types_list: type_arr[item] += 1 #print the max print type_arr.index(max(type_arr))