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

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