from collections import defaultdict
charnums=defaultdict(int)
N=int(input())
for _ in range(N):
    charnums[input()]+=1
ans=[]
m=max(charnums.values())
for key,value in charnums.items():
    if value==m:
        ans.append(key)
for an in sorted(ans):
    print(an) from collections import defaultdict charnums=defaultdict(int) charnums defaultdict(int) defaultdict int N=int(input()) N int(input()) int input() input for _ in range(N):
    charnums[input()]+=1 _ range(N) range N charnums[input()]+=1 charnums[input()] charnums input() input 1 ans=[] ans [] m=max(charnums.values()) m max(charnums.values()) max charnums.values() charnums.values charnums values for key,value in charnums.items():
    if value==m:
        ans.append(key) key value charnums.items() charnums.items charnums items if value==m:
        ans.append(key) value==m value m ans.append(key) ans.append ans append key for an in sorted(ans):
    print(an) an sorted(ans) sorted ans print(an) print an ans=[] [] ans N=int(input()) int(input()) N m=max(charnums.values()) max(charnums.values()) m charnums=defaultdict(int) defaultdict(int) charnums
from collections import defaultdict
charnums=defaultdict(int)
N=int(input())
for _ in range(N):
    charnums[input()]+=1
ans=[]
m=max(charnums.values())
for key,value in charnums.items():
    if value==m:
        ans.append(key)
for an in sorted(ans):
    print(an)