'use strict'
function main(inp) {
  inp = inp.trim().split('\n')
  const N = inp.shift()
  
  inp = inp.sort()  
  let ans = new Set();
  let count = 0;
  let max = 0;
  	for(let i = 0; i < inp.length; i++){
    count++;
    if((i + 1 === N) || inp[i] !== inp[i+1]){
      if(count == max){
        ans.add(inp[i]);
      } else if(count > max){
        ans.clear();
        ans.add(inp[i])
        max = count;
      }     
      count = 0;
    }
  }
  ans.forEach(
    (n) => console.log(n)
  )
}

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