n = int(input().strip()) types = list(map(int, input().strip().split(' '))) occurence = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, } for type in types: occurence[type] += 1 print(max(occurence.keys(), key=(lambda key: occurence[key])))