import sys
N = int(input())

input = sys.stdin.readline
lis = {}
for i in range(N):
  s = input().rstrip()
  if s in lis:
    lis[s] += 1
  else:
    lis[s] = 1
lis2 = sorted(lis.items(), key=lambda x:x[1], reverse=True)
x = next(iter(lis2))
keys = []
for i in lis2:
  if i[1] == x[1]:
    keys.append(i[0])
ans = sorted(keys)
for i in ans:
  print(i) import sys sys N = int(input()) N int(input()) int input() input input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline lis = {} lis {} for i in range(N):
  s = input().rstrip()
  if s in lis:
    lis[s] += 1
  else:
    lis[s] = 1 i range(N) range N s = input().rstrip() s input().rstrip() ().rstrip () input rstrip if s in lis:
    lis[s] += 1
  else:
    lis[s] = 1 s in lis s lis lis[s] += 1 lis[s] lis s 1 lis[s] = 1 lis[s] lis s 1 lis2 = sorted(lis.items(), key=lambda x:x[1], reverse=True) lis2 sorted(lis.items(), key=lambda x:x[1], reverse=True) sorted lis.items() lis.items lis items key=lambda x:x[1] key lambda x:x[1] x[1] x 1 x reverse=True reverse True x = next(iter(lis2)) x next(iter(lis2)) next iter(lis2) iter lis2 keys = [] keys [] for i in lis2:
  if i[1] == x[1]:
    keys.append(i[0]) i lis2 if i[1] == x[1]:
    keys.append(i[0]) i[1] == x[1] i[1] i 1 x[1] x 1 keys.append(i[0]) keys.append keys append i[0] i 0 ans = sorted(keys) ans sorted(keys) sorted keys for i in ans:
  print(i) i ans print(i) print i keys = [] [] keys N = int(input()) int(input()) N x = next(iter(lis2)) next(iter(lis2)) x s = input().rstrip() input().rstrip() s ans = sorted(keys) sorted(keys) ans lis2 = sorted(lis.items(), key=lambda x:x[1], reverse=True) sorted(lis.items(), key=lambda x:x[1], reverse=True) lis2 input = sys.stdin.readline sys.stdin.readline input lis = {} {} lis
import sys
N = int(input())

input = sys.stdin.readline
lis = {}
for i in range(N):
  s = input().rstrip()
  if s in lis:
    lis[s] += 1
  else:
    lis[s] = 1
lis2 = sorted(lis.items(), key=lambda x:x[1], reverse=True)
x = next(iter(lis2))
keys = []
for i in lis2:
  if i[1] == x[1]:
    keys.append(i[0])
ans = sorted(keys)
for i in ans:
  print(i)