#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here type_freq = [0,0,0,0,0] for bird in types: num_of_type = type_freq[bird - 1] num_of_type = num_of_type + 1 type_freq[bird - 1] = num_of_type max_freq = 0; max_type = 0; for i in range(len(type_freq)): if type_freq[i] > max_freq: max_freq = type_freq[i] max_type = i print(max_type+1)