from collections import defaultdict
d = defaultdict(int)
n = int(input())
for _ in range(n): d[input()] += 1
s = sorted(d.items(), key=lambda x: (-x[1], x[0]))
nmax = s[0][1]
for i in s:
  if i[1] != nmax: break
  print(i[0]) from collections import defaultdict d = defaultdict(int) d defaultdict(int) defaultdict int n = int(input()) n int(input()) int input() input for _ in range(n): d[input()] += 1 _ range(n) range n s = sorted(d.items(), key=lambda x: (-x[1], x[0])) s sorted(d.items(), key=lambda x: (-x[1], x[0])) sorted d.items() d.items d items key=lambda x: (-x[1], x[0]) key lambda x: (-x[1], x[0]) (-x[1], x[0]) -x[1] x[1] x 1 x[0] x 0 x nmax = s[0][1] nmax s[0][1] [0] s 0 1 for i in s:
  if i[1] != nmax: break
  print(i[0]) i s if i[1] != nmax: break
   i[1] != nmax i[1] i 1 nmax print(i[0]) print i[0] i 0 n = int(input()) int(input()) n nmax = s[0][1] s[0][1] nmax d = defaultdict(int) defaultdict(int) d s = sorted(d.items(), key=lambda x: (-x[1], x[0])) sorted(d.items(), key=lambda x: (-x[1], x[0])) s
from collections import defaultdict
d = defaultdict(int)
n = int(input())
for _ in range(n): d[input()] += 1
s = sorted(d.items(), key=lambda x: (-x[1], x[0]))
nmax = s[0][1]
for i in s:
  if i[1] != nmax: break
  print(i[0])