from collections import defaultdict

n = int(input())
max_ = 0
dd = defaultdict(int)
for _ in range(n):
  s = input()
  dd[s] += 1
  max_ = max(max_, dd[s])
ans = []
for key, value in dd.items():
  if value == max_:
    ans.append(key)
ans.sort()
print(*ans, sep = "\n") from collections import defaultdict n = int(input()) n int(input()) int input() input max_ = 0 max_ 0 dd = defaultdict(int) dd defaultdict(int) defaultdict int for _ in range(n):
  s = input()
  dd[s] += 1
  max_ = max(max_, dd[s]) _ range(n) range n s = input() s input() input dd[s] += 1 dd[s] dd s 1 max_ = max(max_, dd[s]) max_ max(max_, dd[s]) max max_ dd[s] dd s ans = [] ans [] for key, value in dd.items():
  if value == max_:
    ans.append(key) key value dd.items() dd.items dd items if value == max_:
    ans.append(key) value == max_ value max_ ans.append(key) ans.append ans append key ans.sort() ans.sort ans sort print(*ans, sep = "\n") print *ans ans sep = "\n" sep "\n" ans = [] [] ans s = input() input() s n = int(input()) int(input()) n max_ = 0 0 max_ dd = defaultdict(int) defaultdict(int) dd max_ = max(max_, dd[s]) max(max_, dd[s]) max_
from collections import defaultdict

n = int(input())
max_ = 0
dd = defaultdict(int)
for _ in range(n):
  s = input()
  dd[s] += 1
  max_ = max(max_, dd[s])
ans = []
for key, value in dd.items():
  if value == max_:
    ans.append(key)
ans.sort()
print(*ans, sep = "\n")