#!/bin/python import sys def count(types): counter = [0, 0, 0, 0, 0] for i in types: counter[i - 1] += 1 return counter def getMaxIndex(counter): max = 1 for count,i in enumerate(counter): if i>counter[max-1]: max = count+1 else: return max n = int(raw_input().strip()) types = map(int, raw_input().strip().split(' ')) counter = count(types) print getMaxIndex(counter)