from collections import Counter



N = int(input())

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



dic = Counter(S)



tmp = max(dic.values())

ans = [key for key, value in dic.items() if value == tmp]



# もうちょいかっこいい書き方があるはず。リストを1行1str出力 and 最後に改行しないように

for key in sorted(ans):

    print(key, end="")

    print("")

from collections import Counter



N = int(input())

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



dic = Counter(S)



tmp = max(dic.values()) # ここ重要！

ans = [key for key, value in dic.items() if value == tmp]



# もうちょいかっこいい書き方があるはず。リストを1行1str出力 and 最後に改行しないように

"""

for key in sorted(ans):

    print(key, end="")

    print("")

"""





ans.sort()

print(*ans, sep="\n")





# print(*ans, sep="\n") かっこいい書き方

from collections import Counter

N = int(input())
S = [input() for _ in range(N)]
dic = Counter(S)
tmp = max(dic.values())
ans = [key for key, value in dic.items() if value == tmp]
# もうちょいかっこいい書き方があるはず。リストを1行1str出力 and 最後に改行しないように
for key in sorted(ans):
    print(key, end="")
    print("")

from collections import Counter

N = int(input())
S = [input() for _ in range(N)]
dic = Counter(S)
tmp = max(dic.values())  # ここ重要！
ans = [key for key, value in dic.items() if value == tmp]
# もうちょいかっこいい書き方があるはず。リストを1行1str出力 and 最後に改行しないように
"""
for key in sorted(ans):
    print(key, end="")
    print("")
"""
ans.sort()
print(*ans, sep="\n")
# print(*ans, sep="\n") かっこいい書き方

-tmp = max(dic.values()) +tmp = max(dic.values())  # ここ重要！ +""" +""" +ans.sort() +print(*ans, sep="\n") +# print(*ans, sep="\n") かっこいい書き方