#!/bin/python from collections import Counter import sys n = int(raw_input().strip()) types = map(int, raw_input().strip().split(' ')) dict={} for i in range (len(types)): if dict.has_key(types[i]): dict[types[i]]+=1 else : dict[types[i]]=1 max=[0,0] for i in range(1,6): if dict.has_key(i): if dict[i]>max[1]: max[1]=dict[i] max[0]=i print max[0]