from collections import Counter



n = int(input())

S = [input() for i in range(n)]



L = Counter(S)

m = 0

for v in L.values():

    m = max(m, v)

ans = []

for k, v in L.items():

    if v == m:

        ans.append(k)

ans.sort()

print(*ans, sep="\n")

from collections import Counter



N = int(input())

S = [input() for i in range(N)]



C = Counter(S)

max_cnt = max(C.values())



names = [names for names, values in C.items() if values == max_cnt]

names.sort()



print(*names, sep="\n")



from collections import Counter

n = int(input())
S = [input() for i in range(n)]
L = Counter(S)
m = 0
for v in L.values():
    m = max(m, v)
ans = []
for k, v in L.items():
    if v == m:
        ans.append(k)
ans.sort()
print(*ans, sep="\n")

from collections import Counter

N = int(input())
S = [input() for i in range(N)]
C = Counter(S)
max_cnt = max(C.values())
names = [names for names, values in C.items() if values == max_cnt]
names.sort()
print(*names, sep="\n")

-n = int(input()) -S = [input() for i in range(n)] -L = Counter(S) -m = 0 -for v in L.values(): -    m = max(m, v) -ans = [] -for k, v in L.items(): -    if v == m: -        ans.append(k) -ans.sort() -print(*ans, sep="\n") +N = int(input()) +S = [input() for i in range(N)] +C = Counter(S) +max_cnt = max(C.values()) +names = [names for names, values in C.items() if values == max_cnt] +names.sort() +print(*names, sep="\n")