N = input() votes = [0] * 7 for lv in map(int, raw_input().strip().split(" ")): votes[lv] += 1 max_votes = 0 lv = 0 for i in range(7): if votes[i] >= max_votes: max_votes = votes[i] lv = i print(lv)