import collections

N = int(input())

S_list = []

for i in range(N):
    s = input()
    S_list.append(s)

c = collections.Counter(S_list)
c_max = c.most_common()
max_num = c.most_common()[0][1]
ans_list = []
ans_list.append(c.most_common()[0][0])

for i in range(1, len(c_max)):
    if c_max[i][1] != max_num:
        break
    else:
        ans_list.append(c_max[i][0])

print(*sorted(ans_list), sep='\n') import collections collections N = int(input()) N int(input()) int input() input S_list = [] S_list [] for i in range(N):
    s = input()
    S_list.append(s) i range(N) range N s = input() s input() input S_list.append(s) S_list.append S_list append s c = collections.Counter(S_list) c collections.Counter(S_list) collections.Counter collections Counter S_list c_max = c.most_common() c_max c.most_common() c.most_common c most_common max_num = c.most_common()[0][1] max_num c.most_common()[0][1] [0] c.most_common() c.most_common c most_common 0 1 ans_list = [] ans_list [] ans_list.append(c.most_common()[0][0]) ans_list.append ans_list append c.most_common()[0][0] [0] c.most_common() c.most_common c most_common 0 0 for i in range(1, len(c_max)):
    if c_max[i][1] != max_num:
        break
    else:
        ans_list.append(c_max[i][0]) i range(1, len(c_max)) range 1 len(c_max) len c_max if c_max[i][1] != max_num:
        break
    else:
        ans_list.append(c_max[i][0]) c_max[i][1] != max_num c_max[i][1] [i] c_max i 1 max_num break ans_list.append(c_max[i][0]) ans_list.append ans_list append c_max[i][0] [i] c_max i 0 print(*sorted(ans_list), sep='\n') print *sorted(ans_list) sorted(ans_list) sorted ans_list sep='\n' sep '\n' c_max = c.most_common() c.most_common() c_max N = int(input()) int(input()) N ans_list = [] [] ans_list s = input() input() s c = collections.Counter(S_list) collections.Counter(S_list) c S_list = [] [] S_list max_num = c.most_common()[0][1] c.most_common()[0][1] max_num
import collections

N = int(input())

S_list = []

for i in range(N):
    s = input()
    S_list.append(s)

c = collections.Counter(S_list)
c_max = c.most_common()
max_num = c.most_common()[0][1]
ans_list = []
ans_list.append(c.most_common()[0][0])

for i in range(1, len(c_max)):
    if c_max[i][1] != max_num:
        break
    else:
        ans_list.append(c_max[i][0])

print(*sorted(ans_list), sep='\n')
