import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N,*L = map(int,read().split()) counter = [0] * 7 for x in L: counter[x] += 1 answer = 0 max_ctr = 0 for i,x in enumerate(counter): if max_ctr <= x: max_ctr = x answer = i print(answer)