N = int(input())

d = dict()

for i in range(N):
  s = input()
  if s in d:
    d[s]+=1
  else:
    d[s]=1

d = sorted(d.items(), key=lambda x:-x[1])
i=0
ans=[]
while i<len(d):
  ans.append(d[i][0])
  if i<len(d)-1 and d[i+1][1]==d[i][1]:
      i+=1
  else:
    break

ans = sorted(ans)

for i in range(len(ans)):
  print(ans[i]) N = int(input()) N int(input()) int input() input d = dict() d dict() dict for i in range(N):
  s = input()
  if s in d:
    d[s]+=1
  else:
    d[s]=1 i range(N) range N s = input() s input() input if s in d:
    d[s]+=1
  else:
    d[s]=1 s in d s d d[s]+=1 d[s] d s 1 d[s]=1 d[s] d s 1 d = sorted(d.items(), key=lambda x:-x[1]) d sorted(d.items(), key=lambda x:-x[1]) sorted d.items() d.items d items key=lambda x:-x[1] key lambda x:-x[1] -x[1] x[1] x 1 x i=0 i 0 ans=[] ans [] while i<len(d):
  ans.append(d[i][0])
  if i<len(d)-1 and d[i+1][1]==d[i][1]:
      i+=1
  else:
    break i<len(d) i len(d) len d ans.append(d[i][0]) ans.append ans append d[i][0] [i] d i 0 if i<len(d)-1 and d[i+1][1]==d[i][1]:
      i+=1
  else:
    break i<len(d)-1 and d[i+1][1]==d[i][1] i<len(d)-1 i len(d)-1 len(d) len d 1 d[i+1][1]==d[i][1] d[i+1][1] [i+1] d i+1 i 1 1 d[i][1] [i] d i 1 i+=1 i 1 break ans = sorted(ans) ans sorted(ans) sorted ans for i in range(len(ans)):
  print(ans[i]) i range(len(ans)) range len(ans) len ans print(ans[i]) print ans[i] ans i N = int(input()) int(input()) N d = dict() dict() d ans=[] [] ans ans = sorted(ans) sorted(ans) ans d = sorted(d.items(), key=lambda x:-x[1]) sorted(d.items(), key=lambda x:-x[1]) d s = input() input() s i=0 0 i i+=1 1 i
N = int(input())

d = dict()

for i in range(N):
  s = input()
  if s in d:
    d[s]+=1
  else:
    d[s]=1

d = sorted(d.items(), key=lambda x:-x[1])
i=0
ans=[]
while i<len(d):
  ans.append(d[i][0])
  if i<len(d)-1 and d[i+1][1]==d[i][1]:
      i+=1
  else:
    break

ans = sorted(ans)

for i in range(len(ans)):
  print(ans[i])