var fs = require("fs");
var buffer = fs.readFileSync(0); // STDIN_FILENO = 0
var lines = buffer.toString().split('\n');

function solve(lines) {
  var N = lines[0];
  var lineNo = 1;
  var dict = {};
  var word;
  var max = 1;
  for(var i = 0; i < N; i++){
    word = lines[lineNo++]
    if(dict.hasOwnProperty(word)){
      dict[word]++;
      if(dict[word] > max) {
        max = dict[word];
      }
    }else{
      dict[word] = 1;
    }
  }
  var words = Object.keys(dict);
  var key;
  var results = [];
  for(var i = 0; i < words.length; i++){
    key = words[i];
    if(dict[key] == max){
      results.push(key)
    }
  }
  results.sort();
  for(var i = 0; i < results.length; i++){
    console.log(results[i])
  }
}

solve(lines);

