from collections import defaultdict dd = defaultdict(int) mx, nm = 0, 0 n = int(input()) for i in range(n): s = len(input()) - 2 dd[s] += 1 if dd[s] > mx or dd[s] >= mx and s > nm: mx, nm = dd[s], s print(s)