N = int(input()) l = list(map(int, input().split())) current = 0 currentCount = 0 l.sort() for i in l: if l.count(i) >= currentCount: currentCount = l.count(i) print(l.count(i)) current = i print(current)