import collections

n = int(input())
s = [''] * n
for i in range(n):
    s[i] = input()

cs = collections.Counter(s)
mcs = cs.most_common()
cnt = mcs[0][1]

fcs = [i[0] for i in cs.items() if i[1] == cnt]
ans = sorted(fcs)
for s in ans:
    print(s) import collections collections n = int(input()) n int(input()) int input() input s = [''] * n s [''] * n [''] '' n for i in range(n):
    s[i] = input() i range(n) range n s[i] = input() s[i] s i input() input cs = collections.Counter(s) cs collections.Counter(s) collections.Counter collections Counter s mcs = cs.most_common() mcs cs.most_common() cs.most_common cs most_common cnt = mcs[0][1] cnt mcs[0][1] [0] mcs 0 1 i[0] for i in cs.items() if i[1] == cnt for i in cs.items() if i[1] == cnt i cs.items() cs.items cs items i[1] == cnt i[1] i 1 cnt if i[1] == cnt i[0] i 0 fcs = [i[0] for i in cs.items() if i[1] == cnt] fcs [i[0] for i in cs.items() if i[1] == cnt] ans = sorted(fcs) ans sorted(fcs) sorted fcs for s in ans:
    print(s) s ans print(s) print s mcs = cs.most_common() cs.most_common() mcs ans = sorted(fcs) sorted(fcs) ans cs = collections.Counter(s) collections.Counter(s) cs n = int(input()) int(input()) n fcs = [i[0] for i in cs.items() if i[1] == cnt] [i[0] for i in cs.items() if i[1] == cnt] fcs s = [''] * n [''] * n s cnt = mcs[0][1] mcs[0][1] cnt
import collections

n = int(input())
s = [''] * n
for i in range(n):
    s[i] = input()

cs = collections.Counter(s)
mcs = cs.most_common()
cnt = mcs[0][1]

fcs = [i[0] for i in cs.items() if i[1] == cnt]
ans = sorted(fcs)
for s in ans:
    print(s)
