from collections import Counter
def solve():
  N = int(input())
  S = [input() for _ in range(N)]
  c = Counter(S)
  M = max(c.values())
  ans = []
  for k,v in c.items():
    if v==M:
      ans.append(k)
  ans.sort()
  return ans
print(*solve(),sep='\n') from collections import Counter def solve():
  N = int(input())
  S = [input() for _ in range(N)]
  c = Counter(S)
  M = max(c.values())
  ans = []
  for k,v in c.items():
    if v==M:
      ans.append(k)
  ans.sort()
  return ans solve N = int(input()) N int(input()) int input() input input() for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) input() input S = [input() for _ in range(N)] S [input() for _ in range(N)] c = Counter(S) c Counter(S) Counter S M = max(c.values()) M max(c.values()) max c.values() c.values c values ans = [] ans [] for k,v in c.items():
    if v==M:
      ans.append(k)
   k v c.items() c.items c items if v==M:
      ans.append(k)
   v==M v M ans.append(k) ans.append ans append k ans.sort() ans.sort ans sort return ans ans print(*solve(),sep='\n') print *solve() solve() solve sep='\n' sep '\n' def solve():
  N = int(input())
  S = [input() for _ in range(N)]
  c = Counter(S)
  M = max(c.values())
  ans = []
  for k,v in c.items():
    if v==M:
      ans.append(k)
  ans.sort()
  return ans def solve():
  N = int(input())
  S = [input() for _ in range(N)]
  c = Counter(S)
  M = max(c.values())
  ans = []
  for k,v in c.items():
    if v==M:
      ans.append(k)
  ans.sort()
  return ans solve
from collections import Counter
def solve():
  N = int(input())
  S = [input() for _ in range(N)]
  c = Counter(S)
  M = max(c.values())
  ans = []
  for k,v in c.items():
    if v==M:
      ans.append(k)
  ans.sort()
  return ans
print(*solve(),sep='\n')