import sys n = int(input()) types = [] if n >= 5: types = map(int, raw_input().split(' ')) else: print 'Insufficient length.' k = max(set(types), key = types.count) print k