level_list = [] max_num = 0 for i in range(6): level_list.append(0) N = int(input()) L = [int(x) for x in input().split()] for k in range(N): list_num = L.count(k) if list_num >= max_num: max_num = list_num ans = k print(ans)