#!/bin/python import sys n = int(raw_input().strip()) types = map(int, raw_input().strip().split(' ')) # your code goes here types.sort() maxi = None count = 0 current_count = 0 for i in range(1, len(types)): if types[i] == types[i-1]: current_count += 1 if current_count > count: maxi = types[i] count = current_count else: current_count = 1 print maxi