#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here freq = {1:0, 2:0, 3:0, 4:0, 5:0} for kind in types: freq[kind] += 1 maxKey = 0 for k, v in freq.items(): if maxKey != 0: if v > freq[maxKey]: maxKey = k elif maxKey == 0: maxKey = k print(maxKey)