#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here distinct_types = [1,2,3,4,5] d ={} min_freq = -1 for t in distinct_types: d[t]=0 for t in types: d[t] += 1 for t in distinct_types: if d[t]>min_freq: min_freq = d[t] most_common = t print(most_common)