#!/bin/python3

import sys


n = int(input().strip())
types = list(map(int, input().strip().split(' ')))
# your code goes here
res = [0]*5
for i in types:
    res[i-1] +=1
max_value = max(res)
print(res.index(max_value)+1)