from collections import defaultdict
from sys import stdin
input = stdin.readline


def main():
  N = int(input())
  dic = defaultdict(int)
  for i in range(N):
    dic[input()[:-1]] += 1

  max_ = max(dic.values())
  out = []
  for key, val in dic.items():
    if val == max_:
      out.append(key)

  print(*sorted(out), sep='\n')


if(__name__ == '__main__'):
  main() from collections import defaultdict from sys import stdin input = stdin.readline input stdin.readline stdin readline def main():
  N = int(input())
  dic = defaultdict(int)
  for i in range(N):
    dic[input()[:-1]] += 1

  max_ = max(dic.values())
  out = []
  for key, val in dic.items():
    if val == max_:
      out.append(key)

  print(*sorted(out), sep='\n') main N = int(input()) N int(input()) int input() input dic = defaultdict(int) dic defaultdict(int) defaultdict int for i in range(N):
    dic[input()[:-1]] += 1

   i range(N) range N dic[input()[:-1]] += 1 dic[input()[:-1]] dic input()[:-1] () input :-1 -1 1 max_ = max(dic.values()) max_ max(dic.values()) max dic.values() dic.values dic values out = [] out [] for key, val in dic.items():
    if val == max_:
      out.append(key)

   key val dic.items() dic.items dic items if val == max_:
      out.append(key)

   val == max_ val max_ out.append(key) out.append out append key print(*sorted(out), sep='\n') print *sorted(out) sorted(out) sorted out sep='\n' sep '\n' if(__name__ == '__main__'):
  main() __name__ == '__main__' __name__ '__main__' main() main input = stdin.readline stdin.readline input def main():
  N = int(input())
  dic = defaultdict(int)
  for i in range(N):
    dic[input()[:-1]] += 1

  max_ = max(dic.values())
  out = []
  for key, val in dic.items():
    if val == max_:
      out.append(key)

  print(*sorted(out), sep='\n') def main():
  N = int(input())
  dic = defaultdict(int)
  for i in range(N):
    dic[input()[:-1]] += 1

  max_ = max(dic.values())
  out = []
  for key, val in dic.items():
    if val == max_:
      out.append(key)

  print(*sorted(out), sep='\n') main
from collections import defaultdict
from sys import stdin
input = stdin.readline


def main():
  N = int(input())
  dic = defaultdict(int)
  for i in range(N):
    dic[input()[:-1]] += 1

  max_ = max(dic.values())
  out = []
  for key, val in dic.items():
    if val == max_:
      out.append(key)

  print(*sorted(out), sep='\n')


if(__name__ == '__main__'):
  main()
