#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here type_count = [0] * (n + 1) for t in types: type_count[t] += 1 max_type = 1 for i in range(1, n + 1): if type_count[i] > type_count[max_type]: max_type = i print(max_type)