from collections import Counter

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

C = Counter(S)

C = sorted(C.items(), key=lambda x:x[1], reverse=True)


cnt_max = C[0][1]
ans = []
for i in range(len(C)):
    if cnt_max > C[i][1]:
        break
    else:
        ans.append(C[i][0])

ans.sort()

for w in ans:
    print(w) from collections import Counter N = int(input()) N int(input()) int input() input input() for i in range(N) for i in range(N) i range(N) range N for i in range(N) input() input S = [input() for i in range(N)] S [input() for i in range(N)] C = Counter(S) C Counter(S) Counter S C = sorted(C.items(), key=lambda x:x[1], reverse=True) C sorted(C.items(), key=lambda x:x[1], reverse=True) sorted C.items() C.items C items key=lambda x:x[1] key lambda x:x[1] x[1] x 1 x reverse=True reverse True cnt_max = C[0][1] cnt_max C[0][1] [0] C 0 1 ans = [] ans [] for i in range(len(C)):
    if cnt_max > C[i][1]:
        break
    else:
        ans.append(C[i][0]) i range(len(C)) range len(C) len C if cnt_max > C[i][1]:
        break
    else:
        ans.append(C[i][0]) cnt_max > C[i][1] cnt_max C[i][1] [i] C i 1 break ans.append(C[i][0]) ans.append ans append C[i][0] [i] C i 0 ans.sort() ans.sort ans sort for w in ans:
    print(w) w ans print(w) print w S = [input() for i in range(N)] [input() for i in range(N)] S C = Counter(S) Counter(S) C cnt_max = C[0][1] C[0][1] cnt_max N = int(input()) int(input()) N C = sorted(C.items(), key=lambda x:x[1], reverse=True) sorted(C.items(), key=lambda x:x[1], reverse=True) C ans = [] [] ans
from collections import Counter

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

C = Counter(S)

C = sorted(C.items(), key=lambda x:x[1], reverse=True)


cnt_max = C[0][1]
ans = []
for i in range(len(C)):
    if cnt_max > C[i][1]:
        break
    else:
        ans.append(C[i][0])

ans.sort()

for w in ans:
    print(w)