dic = {}
l = []
n = int(input())
for i in range(n):
    s = input()

#sが新規キーか否かで操作を変える
    if s in dic:
        dic[s] += 1
#新規ではないならvalueを1増やす
    else:
        dic[s] = 1
          
m = max(dic.values())

for i in dic:
    if dic[i] == m:
        l += [i]

print(*sorted(l)) dic = {} dic {} l = [] l [] n = int(input()) n int(input()) int input() input for i in range(n):
    s = input()

#sが新規キーか否かで操作を変える
    if s in dic:
        dic[s] += 1
#新規ではないならvalueを1増やす
    else:
        dic[s] = 1
           i range(n) range n s = input() s input() input if s in dic:
        dic[s] += 1
#新規ではないならvalueを1増やす
    else:
        dic[s] = 1
           s in dic s dic dic[s] += 1 dic[s] dic s 1 dic[s] = 1 dic[s] dic s 1 m = max(dic.values()) m max(dic.values()) max dic.values() dic.values dic values for i in dic:
    if dic[i] == m:
        l += [i] i dic if dic[i] == m:
        l += [i] dic[i] == m dic[i] dic i m l += [i] l [i] i print(*sorted(l)) print *sorted(l) sorted(l) sorted l dic = {} {} dic l = [] [] l m = max(dic.values()) max(dic.values()) m l += [i] [i] l n = int(input()) int(input()) n s = input() input() s
dic = {}
l = []
n = int(input())
for i in range(n):
    s = input()

#sが新規キーか否かで操作を変える
    if s in dic:
        dic[s] += 1
#新規ではないならvalueを1増やす
    else:
        dic[s] = 1
          
m = max(dic.values())

for i in dic:
    if dic[i] == m:
        l += [i]

print(*sorted(l))