function Main(input) {
  input = input.split("\n");
  var a = input[0];
  var S = Array();
  var ans = [];
  input.shift();
  var counts = [];
  for(var i=0;i< input.length;i++){
    var key = input[i];
    counts[key] = (counts[key])? counts[key] + 1 : 1 ;
  }
  input = input.filter(function (x, i, self) {
    return self.indexOf(x) === i;
  });
  input.sort();
  var max=0;
  for(var i=0;i<input.length;i++){
    if(max<counts[input[i]]){
      ans=[];
      ans[0]=input[i];
      max=counts[input[i]];
    }else if(max==counts[input[i]]){
      ans.push(input[i]);
    }
  }
  for(var i=0;i<ans.length;i++){
    console.log(ans[i]);
  }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));