#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here count = [0] * 6 for i in range(n): count[types[i]-1] += 1 max_count = max(count) max_index = count.index(max_count) for i in range(5): if count[i] == max_count: if max_index > i: max_index = i print(max_index+1)