n = input() v = list(map( int, input().split())) print(sorted(set(v), key = v.count)[-1])