#!/bin/python import sys from collections import * n = int(raw_input().strip()) types = map(int, raw_input().strip().split(' ')) # your code goes here dd = defaultdict(int) for t in types: if dd[t]: dd[t]+=1 else: dd[t]=1 v = sorted(dd.iteritems(), reverse=True, key=lambda(k,v): v)[0] a, b = v print a