"use strict"
function Main(input) {
  input = input.trim().split('\n');
  const N = Number(input[0]);
  const S = input.slice(1, N+1);

  let o = {};
  for(let i=0; i<N; i++){
    o[S[i]] = o[S[i]] ? o[S[i]] + 1 : 1;
  }

  let max = 0;
  for(let k in o){
    if(max < o[k]) max = o[k];
  }

  let ret = [];
  for(let k in o) {
    if(o[k] === max) ret.push(k);
  }

  let ans = ret.sort((a, b) => a > b);

  console.log(ans.join('\n'));
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));