from itertools import groupby

from operator import itemgetter

 

a = sorted(eval(input()) for _ in range(int(eval(input()))))

a = sorted((-len(tuple(g)), s) for s, g in groupby(a))

for _, s in next(groupby(a, itemgetter(0)))[1]:

  print(s)
from collections import Counter



c = Counter(eval(input()) for _ in range(int(eval(input()))))

m = max(c.values())

for s in sorted(s for s, k in list(c.items()) if k == m): 

  print(s)

from itertools import groupby
from operator import itemgetter

a = sorted(eval(input()) for _ in range(int(eval(input()))))
a = sorted((-len(tuple(g)), s) for s, g in groupby(a))
for _, s in next(groupby(a, itemgetter(0)))[1]:
    print(s)

from collections import Counter

c = Counter(eval(input()) for _ in range(int(eval(input()))))
m = max(c.values())
for s in sorted(s for s, k in list(c.items()) if k == m):
    print(s)

-from itertools import groupby -from operator import itemgetter +from collections import Counter -a = sorted(eval(input()) for _ in range(int(eval(input())))) -a = sorted((-len(tuple(g)), s) for s, g in groupby(a)) -for _, s in next(groupby(a, itemgetter(0)))[1]: +c = Counter(eval(input()) for _ in range(int(eval(input())))) +m = max(c.values()) +for s in sorted(s for s, k in list(c.items()) if k == m):