from collections import defaultdict



N = int(input())

s_counter = defaultdict(int)

for _ in range(N):

    S = input()

    s_counter[S] += 1

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

answer = []

for i in range(len(S_list)):

    if S_list[0][1] != S_list[i][1]:

        break

    answer.append(S_list[i][0])

answer.sort()

[print(a) for a in answer]

from collections import Counter



N = int(input())

counter = Counter([input() for _ in range(N)])

max_cnt = max(counter.values())

names = [name for name, cnt in counter.items() if cnt == max_cnt]

names.sort()



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

from collections import defaultdict

N = int(input())
s_counter = defaultdict(int)
for _ in range(N):
    S = input()
    s_counter[S] += 1
S_list = sorted(s_counter.items(), key=lambda x: x[1], reverse=True)
answer = []
for i in range(len(S_list)):
    if S_list[0][1] != S_list[i][1]:
        break
    answer.append(S_list[i][0])
answer.sort()
[print(a) for a in answer]

from collections import Counter

N = int(input())
counter = Counter([input() for _ in range(N)])
max_cnt = max(counter.values())
names = [name for name, cnt in counter.items() if cnt == max_cnt]
names.sort()
print(*names, sep="\n")

-from collections import defaultdict +from collections import Counter -s_counter = defaultdict(int) -for _ in range(N): -    S = input() -    s_counter[S] += 1 -S_list = sorted(s_counter.items(), key=lambda x: x[1], reverse=True) -answer = [] -for i in range(len(S_list)): -    if S_list[0][1] != S_list[i][1]: -        break -    answer.append(S_list[i][0]) -answer.sort() -[print(a) for a in answer] +counter = Counter([input() for _ in range(N)]) +max_cnt = max(counter.values()) +names = [name for name, cnt in counter.items() if cnt == max_cnt] +names.sort() +print(*names, sep="\n")