#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here i , j, k, l, m = 0, 0, 0, 0, 0 for type in types: if type == 1: i += 1 if type == 2: j += 1 if type == 3: k += 1 if type == 4: l += 1 if type == 5: m += 1 largest = max([i , j, k, l, m]) nums_of_each_type = [(1, i) ,(2, j), (3, k), (4, l), (5, m)] most_common = [] for x in range(len(nums_of_each_type)): if nums_of_each_type[x][1] == largest: most_common.append(nums_of_each_type[x][0]) if len(most_common) == 1: print(most_common[0]) elif len(most_common) > 1: print(min(most_common))