import sys

N = int(eval(input()))

S = (str(x) for x in sys.stdin.read().split())

cnt = {}

for s in S:

  if cnt.get(s):

    cnt[s] = cnt[s] + 1

  else:

    cnt[s] = 1

max_cnt = max(cnt.values())

keys = [k for k, v in list(cnt.items()) if v == max_cnt]

for k in sorted(keys):

  print(k)
import sys

from collections import Counter

N = int(eval(input()))

S = (str(x) for x in sys.stdin.read().split())

cnt = Counter(s for s in S)

max_cnt = max(cnt.values())

keys = [k for k, v in list(cnt.items()) if v == max_cnt]

print(("\n".join(sorted(keys))))
import sys

N = int(eval(input()))
S = (str(x) for x in sys.stdin.read().split())
cnt = {}
for s in S:
    if cnt.get(s):
        cnt[s] = cnt[s] + 1
    else:
        cnt[s] = 1
max_cnt = max(cnt.values())
keys = [k for k, v in list(cnt.items()) if v == max_cnt]
for k in sorted(keys):
    print(k)

import sys
from collections import Counter

N = int(eval(input()))
S = (str(x) for x in sys.stdin.read().split())
cnt = Counter(s for s in S)
max_cnt = max(cnt.values())
keys = [k for k, v in list(cnt.items()) if v == max_cnt]
print(("\n".join(sorted(keys))))

+from collections import Counter -cnt = {} -for s in S: -    if cnt.get(s): -        cnt[s] = cnt[s] + 1 -    else: -        cnt[s] = 1 +cnt = Counter(s for s in S) -for k in sorted(keys): -    print(k) +print(("\n".join(sorted(keys))))