function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0]);
  input.shift();
  input.splice(N,input.length);
  var S = input;
  var array = {};
  var max =1;
  for(var i=0;i<N;i++){
    if(array[S[i]]!=undefined){
      var num=array[S[i]];
      num++;
      array[S[i]]=num;
      max=Math.max(max,num);
    }else{
      array[S[i]]=1;
    }
  }
  var anssub=new Array();
  Object.keys(array).forEach(function(key){
    var val=this[key];
    if(val==max){
      anssub.push(key);
    }
  },array);
  anssub.sort(function(a, b){
    a = a.toString().toLowerCase();
    b = b.toString().toLowerCase();
    if(a < b){
        return -1;
    }else if(a > b){
        return 1;
    }
    return 0;
  });
  var ans = anssub.join("\n");

  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));