#!/bin/python3 types = int(input()) birds = [int(tmp) for tmp in input().split()] type_count = [0] * types for bird in birds: type_count[bird] += 1 print(type_count.index(max(type_count)))