from collections import Counter

import sys

n = int(sys.stdin.readline())

sn = sys.stdin.read().split()

c = Counter(sn)

c = sorted(list(c.items()), key=lambda x: (-x[1], x[0]))

num = c[0][1]

for i, j in c:

  if j == num:

    print(i)

  else:

    quit()
from collections import Counter

import sys

n = int(sys.stdin.readline())

sn = sys.stdin.read().split()

c = Counter(sn)

num = max(c.values())

ans = [i for i, j in list(c.items()) if j == num]

ans.sort()

print(('\n'.join(ans)))
from collections import Counter
import sys

n = int(sys.stdin.readline())
sn = sys.stdin.read().split()
c = Counter(sn)
c = sorted(list(c.items()), key=lambda x: (-x[1], x[0]))
num = c[0][1]
for i, j in c:
    if j == num:
        print(i)
    else:
        quit()

from collections import Counter
import sys

n = int(sys.stdin.readline())
sn = sys.stdin.read().split()
c = Counter(sn)
num = max(c.values())
ans = [i for i, j in list(c.items()) if j == num]
ans.sort()
print(("\n".join(ans)))

-c = sorted(list(c.items()), key=lambda x: (-x[1], x[0])) -num = c[0][1] -for i, j in c: -    if j == num: -        print(i) -    else: -        quit() +num = max(c.values()) +ans = [i for i, j in list(c.items()) if j == num] +ans.sort() +print(("\n".join(ans)))