#listの要素をキー、その出現数を値として持つディクショナリを返す
def count(list):
    dict = {}
    for i in range(len(list)):
        dict[list[i]] = dict.get(list[i], 0) + 1
    return dict

n = int(input())
s = []
for _ in range(n):
    s.append(input())

dic = count(s)
lst = sorted(dic.items(), key=lambda x: x[1], reverse=True)
value_max = lst[0][1]
output = []

for name in lst:
    if name[1] == value_max:
        output.append(name[0])
    else:
        break

output.sort()
print(*output,sep="\n") def count(list):
    dict = {}
    for i in range(len(list)):
        dict[list[i]] = dict.get(list[i], 0) + 1
    return dict count dict = {} dict {} for i in range(len(list)):
        dict[list[i]] = dict.get(list[i], 0) + 1
     i range(len(list)) range len(list) len list dict[list[i]] = dict.get(list[i], 0) + 1 dict[list[i]] dict list[i] list i dict.get(list[i], 0) + 1 dict.get(list[i], 0) dict.get dict get list[i] list i 0 1 return dict dict list list n = int(input()) n int(input()) int input() input s = [] s [] for _ in range(n):
    s.append(input()) _ range(n) range n s.append(input()) s.append s append input() input dic = count(s) dic count(s) count s lst = sorted(dic.items(), key=lambda x: x[1], reverse=True) lst sorted(dic.items(), key=lambda x: x[1], reverse=True) sorted dic.items() dic.items dic items key=lambda x: x[1] key lambda x: x[1] x[1] x 1 x reverse=True reverse True value_max = lst[0][1] value_max lst[0][1] [0] lst 0 1 output = [] output [] for name in lst:
    if name[1] == value_max:
        output.append(name[0])
    else:
        break name lst if name[1] == value_max:
        output.append(name[0])
    else:
        break name[1] == value_max name[1] name 1 value_max output.append(name[0]) output.append output append name[0] name 0 break output.sort() output.sort output sort print(*output,sep="\n") print *output output sep="\n" sep "\n" output = [] [] output s = [] [] s n = int(input()) int(input()) n dic = count(s) count(s) dic lst = sorted(dic.items(), key=lambda x: x[1], reverse=True) sorted(dic.items(), key=lambda x: x[1], reverse=True) lst value_max = lst[0][1] lst[0][1] value_max def count(list):
    dict = {}
    for i in range(len(list)):
        dict[list[i]] = dict.get(list[i], 0) + 1
    return dict def count(list):
    dict = {}
    for i in range(len(list)):
        dict[list[i]] = dict.get(list[i], 0) + 1
    return dict count
#listの要素をキー、その出現数を値として持つディクショナリを返す
def count(list):
    dict = {}
    for i in range(len(list)):
        dict[list[i]] = dict.get(list[i], 0) + 1
    return dict

n = int(input())
s = []
for _ in range(n):
    s.append(input())

dic = count(s)
lst = sorted(dic.items(), key=lambda x: x[1], reverse=True)
value_max = lst[0][1]
output = []

for name in lst:
    if name[1] == value_max:
        output.append(name[0])
    else:
        break

output.sort()
print(*output,sep="\n")