#!/bin/python import sys n = int(raw_input().strip()) types = map(int, raw_input().strip().split(' ')) # your code goes here birds = {"1":0,"2":0,"3":0,"4":0,"5":0} for i in types: birds[str(i)] += 1 maxi = 0 index = 0 for j in birds: if birds[j] > maxi: index = j maxi = birds[j] print index