n = int(input()) L = [int(l) for l in input().split()] A = [0 for i in range(7)] for l in L: A[l] += 1 level = -1 m = 0 for l in range(7): if A[l]>=m: level = l m = A[l] print(level)