output_description: Print all strings in question in lexicographical order.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      S_1
      :
      S_N
attempt: def com_str(A, B, i):
      ans = A
      if A == B:
          pass
      elif ord(A[i]) > ord(B[i]):
          pass
      elif ord(B[i]) > ord(A[i]):
          ans = B
      else:
          ans = com_str(A, B, i + 1)
      return ans
  
  
  def quick_sort_str(list, N):
      stand = list[0]
      over = []
      same = []
      under = []
      for i in list:
          if i[N] != stand[N]:
              if stand[N] == com_str(i[N], stand[N], 0):
                  over.append(i)
              else:
                  under.append(i)
          else:
              same.append(i)
      if len(over) > 1:
          over = quick_sort_str(over, N)
      else:
          pass
      if len(under) > 1:
          under = quick_sort_str(under, N)
      else:
          way = [same[0][0], len(same)]
          same.clear()
          same.append(way)
      return over + same + under
  
  
  def quick_sort_num(list, N):
      stand = list[0]
      over = []
      same = []
      under = []
      for i in list:
          if i[N] > stand[N]:
              over.append(i)
          elif i[N] < stand[N]:
              under.append(i)
          else:
              same.append(i)
      if len(over) > 1:
          over = quick_sort_num(over, N)
      else:
          pass
      if len(under) > 1:
          under = quick_sort_num(under, N)
      else:
          pass
  
      return over + same + under
  
  
  N = int(input())
  S = [[] for i in range(N)]
  for i in range(N):
      S[i].append(str(input()))
      S[i].append(1)
  S = quick_sort_str(S, 0)
  S = quick_sort_num(S, 1)
  count = S[0][1]
  for i in range(len(S)):
      if S[i][1] == count:
          print(S[i][0])
      else:
          break
  
problem_description: Statement
  
  We have N voting papers. The i-th vote (1 \leq i \leq N) has the string S_i
  written on it.
  
  Print all strings that are written on the most number of votes, in
  lexicographical order.
samples: [{"input": "7\n    beat\n    vet\n    beet\n    bed\n    vet\n    bet\n    beet", "output": "beet\n    vet\n    \n\n`beet` and `vet` are written on two sheets each, while `beat`, `bed`, and\n`bet` are written on one vote each. Thus, we should print the strings `beet`\nand `vet`.\n\n* * *"}, {"input": "8\n    buffalo\n    buffalo\n    buffalo\n    buffalo\n    buffalo\n    buffalo\n    buffalo\n    buffalo", "output": "buffalo\n    \n\n* * *"}, {"input": "7\n    bass\n    bass\n    kick\n    kick\n    bass\n    kick\n    kick", "output": "kick\n    \n\n* * *"}, {"input": "4\n    ushi\n    tapu\n    nichia\n    kun", "output": "kun\n    nichia\n    tapu\n    ushi"}]