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