import collections

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

cnt = collections.Counter(S)
max_cnt = max(cnt.values())

ans_list = []

for key, value in cnt.items():
    if value == max_cnt:
        ans_list.append(key)

print(*sorted(ans_list), sep='\n')
 import collections collections N = int(input()) N int(input()) int input() input input() for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) input() input S = [input() for _ in range(N)] S [input() for _ in range(N)] cnt = collections.Counter(S) cnt collections.Counter(S) collections.Counter collections Counter S max_cnt = max(cnt.values()) max_cnt max(cnt.values()) max cnt.values() cnt.values cnt values ans_list = [] ans_list [] for key, value in cnt.items():
    if value == max_cnt:
        ans_list.append(key) key value cnt.items() cnt.items cnt items if value == max_cnt:
        ans_list.append(key) value == max_cnt value max_cnt ans_list.append(key) ans_list.append ans_list append key print(*sorted(ans_list), sep='\n') print *sorted(ans_list) sorted(ans_list) sorted ans_list sep='\n' sep '\n' N = int(input()) int(input()) N ans_list = [] [] ans_list cnt = collections.Counter(S) collections.Counter(S) cnt S = [input() for _ in range(N)] [input() for _ in range(N)] S max_cnt = max(cnt.values()) max(cnt.values()) max_cnt
import collections

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

cnt = collections.Counter(S)
max_cnt = max(cnt.values())

ans_list = []

for key, value in cnt.items():
    if value == max_cnt:
        ans_list.append(key)

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

