n = int(input()) levels = list(map(int, input().split())) count = [0] * 7 # Indexes 0 to 6 (0 unused) for lv in levels: count[lv] += 1 max_count = max(count) # Check from highest level to lowest for level in range(6, 0, -1): if count[level] == max_count: print(level) break