N = int(input())

d = {}

for i in range(N):
  key = input()
  try:
    d[key] += 1
  except KeyError:
    d[key] = 1
    
d = sorted(d.items(), key=lambda x: x[1], reverse=True)

ans = []
max = 0
for i in d:
  if i[1] >= max:
    ans.append(i[0])
    max = i[1]
  else:
    break
    
for i in sorted(ans):
  print(i) N = int(input()) N int(input()) int input() input d = {} d {} for i in range(N):
  key = input()
  try:
    d[key] += 1
  except KeyError:
    d[key] = 1
     i range(N) range N key = input() key input() input try:
    d[key] += 1
  except KeyError:
    d[key] = 1
     except KeyError:
    d[key] = 1
     d[key] = 1 d[key] d key 1 d[key] += 1 d[key] d key 1 d = sorted(d.items(), key=lambda x: x[1], reverse=True) d sorted(d.items(), key=lambda x: x[1], reverse=True) sorted d.items() d.items d items key=lambda x: x[1] key lambda x: x[1] x[1] x 1 x reverse=True reverse True ans = [] ans [] max = 0 max 0 for i in d:
  if i[1] >= max:
    ans.append(i[0])
    max = i[1]
  else:
    break
     i d if i[1] >= max:
    ans.append(i[0])
    max = i[1]
  else:
    break
     i[1] >= max i[1] i 1 max ans.append(i[0]) ans.append ans append i[0] i 0 max = i[1] max i[1] i 1 break for i in sorted(ans):
  print(i) i sorted(ans) sorted ans print(i) print i ans = [] [] ans max = i[1] i[1] max N = int(input()) int(input()) N d = {} {} d max = 0 0 max d = sorted(d.items(), key=lambda x: x[1], reverse=True) sorted(d.items(), key=lambda x: x[1], reverse=True) d key = input() input() key
N = int(input())

d = {}

for i in range(N):
  key = input()
  try:
    d[key] += 1
  except KeyError:
    d[key] = 1
    
d = sorted(d.items(), key=lambda x: x[1], reverse=True)

ans = []
max = 0
for i in d:
  if i[1] >= max:
    ans.append(i[0])
    max = i[1]
  else:
    break
    
for i in sorted(ans):
  print(i)