function Main(input) {
  var line = input.split("\n");
  var n = parseFloat(line[0]);
  var ws = {};
  for (var i = 1; i <= n; ++i) {
    if (ws[line[i]] === undefined) {
      ws[line[i]] = 1;
    } else {
      ++ws[line[i]];
    }
  }
  var m = 0;
  for (var w in ws) {
    if (ws[w] > m) m = ws[w];
  }
  var rs = [];
  for (var w in ws) {
    if (ws[w] === m) rs.push(w);
  }
  rs.sort(function(a, b){
    a = a.toString().toLowerCase();
    b = b.toString().toLowerCase();
    if(a < b){
      return -1;
    }else if(a > b){
      return 1;
    }
  });
  for (var r of rs) console.log(r);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));