#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here count={1:0,2:0,3:0,4:0,5:0} maxValue=0 maxID=0 for bird in types: count[bird]=count[bird]+1 if count[bird]>maxValue: maxValue=count[bird] maxID=bird elif count[bird]==maxValue: if bird