"use strict"
function Main(input) {
  input = input.trim().split('\n');
  const N = Number(input[0]);
  const S = input.slice(1, N+1);
  S.sort((a, b) => a > b);
  let obj = {};
  for(let i=0; i<N; i++){
    obj[S[i]] = obj[S[i]] ? obj[S[i]] + 1 : 1;
  }
  

  let max = 0;
  let ret = [];
  for(let k in obj){
    if(max === obj[k]){
      ret.push(k);
    }else if(max < obj[k]){
      ret = [];
      ret.push(k)
      max = obj[k]
    }
  }

  console.log(ret.join('\n'));

}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));