'use strict'

function Main(input) {
  input = input.trim().split('\n')
  const N = input[0]
  const res = input.slice(1)

  let memo = {}

  res.forEach(s => {
    if(!memo[s]) memo[s] = 0
    memo[s] += 1
  })

  let max = 0
  for (let i in memo) {
    if (max < memo[i]) max = memo[i]
  }

  let results = []
  for(let i in memo) {
    if (memo[i] === max) {
      results.push(i)
    }
  }

  results = results.sort()

  let str = results.reduce((pre, curr) => pre += curr + '\n', '')
  str = str.trim()
  console.log(str)
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));