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