from itertools import groupby

from operator import itemgetter



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

a = [(len(tuple(g)), s) for s, g in a]

m = max(a, key=itemgetter(0))[0]

for k, s in a:

  if k == m:

    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 = groupby(sorted(eval(input()) for _ in range(int(eval(input())))))
a = [(len(tuple(g)), s) for s, g in a]
m = max(a, key=itemgetter(0))[0]
for k, s in a:
    if k == m:
        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 = groupby(sorted(eval(input()) for _ in range(int(eval(input()))))) -a = [(len(tuple(g)), s) for s, g in a] -m = max(a, key=itemgetter(0))[0] -for k, s in a: -    if k == m: -        print(s) +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)