N=int(input())
kouholist=[]
worddict=dict()
maxvalue=0
for i in range(N):
    S=input()
    if S in worddict.keys():
        worddict[S]+=1
    else:
        worddict[S]=1
    maxvalue=max(maxvalue,worddict[S])
#print("ここから")
#print(worddict)
for k in worddict.keys():
    if worddict[k]==maxvalue:
        kouholist.append(k)
kouholist=sorted(kouholist)
for h in range(len(kouholist)):
    print(kouholist[h]) N=int(input()) N int(input()) int input() input kouholist=[] kouholist [] worddict=dict() worddict dict() dict maxvalue=0 maxvalue 0 for i in range(N):
    S=input()
    if S in worddict.keys():
        worddict[S]+=1
    else:
        worddict[S]=1
    maxvalue=max(maxvalue,worddict[S])
#print("ここから")
#print(worddict) i range(N) range N S=input() S input() input if S in worddict.keys():
        worddict[S]+=1
    else:
        worddict[S]=1
     S in worddict.keys() S worddict.keys() worddict.keys worddict keys worddict[S]+=1 worddict[S] worddict S 1 worddict[S]=1 worddict[S] worddict S 1 maxvalue=max(maxvalue,worddict[S]) maxvalue max(maxvalue,worddict[S]) max maxvalue worddict[S] worddict S for k in worddict.keys():
    if worddict[k]==maxvalue:
        kouholist.append(k) k worddict.keys() worddict.keys worddict keys if worddict[k]==maxvalue:
        kouholist.append(k) worddict[k]==maxvalue worddict[k] worddict k maxvalue kouholist.append(k) kouholist.append kouholist append k kouholist=sorted(kouholist) kouholist sorted(kouholist) sorted kouholist for h in range(len(kouholist)):
    print(kouholist[h]) h range(len(kouholist)) range len(kouholist) len kouholist print(kouholist[h]) print kouholist[h] kouholist h kouholist=[] [] kouholist kouholist=sorted(kouholist) sorted(kouholist) kouholist maxvalue=max(maxvalue,worddict[S]) max(maxvalue,worddict[S]) maxvalue N=int(input()) int(input()) N worddict=dict() dict() worddict S=input() input() S maxvalue=0 0 maxvalue
N=int(input())
kouholist=[]
worddict=dict()
maxvalue=0
for i in range(N):
    S=input()
    if S in worddict.keys():
        worddict[S]+=1
    else:
        worddict[S]=1
    maxvalue=max(maxvalue,worddict[S])
#print("ここから")
#print(worddict)
for k in worddict.keys():
    if worddict[k]==maxvalue:
        kouholist.append(k)
kouholist=sorted(kouholist)
for h in range(len(kouholist)):
    print(kouholist[h])