'use strict'

function main(inp) {
  inp = inp.trim().split('\n')
  
  const N = Number(inp.shift())

  let obj = []

  for (let s of inp) {
    if (!(s in obj)) obj[s] = 0
    obj[s]++
  }

  let ans = []
  let num = 0

  Object.keys(obj).sort().forEach(s => {
    if (obj[s] === num) {
      ans.push(s)
    } else if (obj[s] > num) {
      num = obj[s]
      ans = [s]
    }
  })

  console.log(ans.join('\n'))
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));
