from collections import defaultdict
N = int(input())
dic = defaultdict(lambda:0)
for _ in range(N):
    key = input()
    dic[key] += 1

maxnum = max(dic.values())
collection = []
for key, value in dic.items():
    if value == maxnum:
        collection.append(key)

collection.sort()
for word in collection:
    print(word) from collections import defaultdict N = int(input()) N int(input()) int input() input dic = defaultdict(lambda:0) dic defaultdict(lambda:0) defaultdict lambda:0 0 for _ in range(N):
    key = input()
    dic[key] += 1 _ range(N) range N key = input() key input() input dic[key] += 1 dic[key] dic key 1 maxnum = max(dic.values()) maxnum max(dic.values()) max dic.values() dic.values dic values collection = [] collection [] for key, value in dic.items():
    if value == maxnum:
        collection.append(key) key value dic.items() dic.items dic items if value == maxnum:
        collection.append(key) value == maxnum value maxnum collection.append(key) collection.append collection append key collection.sort() collection.sort collection sort for word in collection:
    print(word) word collection print(word) print word dic = defaultdict(lambda:0) defaultdict(lambda:0) dic maxnum = max(dic.values()) max(dic.values()) maxnum N = int(input()) int(input()) N key = input() input() key collection = [] [] collection
from collections import defaultdict
N = int(input())
dic = defaultdict(lambda:0)
for _ in range(N):
    key = input()
    dic[key] += 1

maxnum = max(dic.values())
collection = []
for key, value in dic.items():
    if value == maxnum:
        collection.append(key)

collection.sort()
for word in collection:
    print(word)