#!/bin/python3 import sys n = int(input().strip()) types = list(map(int, input().strip().split(' '))) # your code goes here countArray=[0,0,0,0,0,0] for x in range(0, len(types)): countArray[types[x]] += 1 # index 0 is a placeholder max = 0 type = 0 for y in range(0, len(countArray)-1): if max < countArray[y+1]: max = countArray[y+1] print (countArray.index(max))