#!/bin/python3 import sys def findTimes(types, list): for i in types: list[i-1] = list[i-1] + 1 def findLargest(times): largest = 0 index = 0 second = 0 for i, e in enumerate(times): if e > largest: largest = e second = index index = i+1 return second if index < second else index n = int(input().strip()) types = list(map(int, input().strip().split(' '))) times = [0,0,0,0,0] # your code goes here findTimes(types, times) print(findLargest(times))