N = int(input()) L = list(map(int,input().split())) a = [0] * 7 for i in L: a[i] += 1 _max = 6 count = a[6] for i in reversed(range(1,6)): if a[i] > count: count = a[i] _max = i print(_max)