import collections

N = int(input())
cnt = collections.defaultdict(int)

for _ in range(N):
  s = input()
  cnt[s] += 1

max_v = max(cnt.values())
ans   = sorted([k for k, v in cnt.items() if v == max_v])
for s in ans:
  print(s) import collections collections N = int(input()) N int(input()) int input() input cnt = collections.defaultdict(int) cnt collections.defaultdict(int) collections.defaultdict collections defaultdict int for _ in range(N):
  s = input()
  cnt[s] += 1 _ range(N) range N s = input() s input() input cnt[s] += 1 cnt[s] cnt s 1 max_v = max(cnt.values()) max_v max(cnt.values()) max cnt.values() cnt.values cnt values k for k, v in cnt.items() if v == max_v for k, v in cnt.items() if v == max_v k v cnt.items() cnt.items cnt items v == max_v v max_v if v == max_v k ans   = sorted([k for k, v in cnt.items() if v == max_v]) ans sorted([k for k, v in cnt.items() if v == max_v]) sorted [k for k, v in cnt.items() if v == max_v] for s in ans:
  print(s) s ans print(s) print s s = input() input() s ans   = sorted([k for k, v in cnt.items() if v == max_v]) sorted([k for k, v in cnt.items() if v == max_v]) ans cnt = collections.defaultdict(int) collections.defaultdict(int) cnt N = int(input()) int(input()) N max_v = max(cnt.values()) max(cnt.values()) max_v
import collections

N = int(input())
cnt = collections.defaultdict(int)

for _ in range(N):
  s = input()
  cnt[s] += 1

max_v = max(cnt.values())
ans   = sorted([k for k, v in cnt.items() if v == max_v])
for s in ans:
  print(s)
