n = int(input()) ans = [0]*7 for c in map(int,input().split()): ans[c] += 1 m = max(ans) for i in range(7)[::-1]: if ans[i] == m: print(i) exit()