#!/bin/python import sys n = int(raw_input().strip()) types = map(int, raw_input().strip().split(' ')) count_dict = {1:0,2:0,3:0,4:0,5:0} for t in types: if int(t) == 1: count_dict[1] += 1 if int(t) == 2: count_dict[2] += 1 if int(t) == 3: count_dict[3] += 1 if int(t) == 4: count_dict[4] += 1 if int(t) == 5: count_dict[5] += 1 sorted_type_count = sorted(count_dict.iteritems(),reverse=True,key = lambda (k,v): v) print sorted_type_count[0][0]