process.stdin.resume();
process.stdin.setEncoding('utf8');

var input = '';
process.stdin.on('data', (chunk) => {
  input += chunk;
});
process.stdin.on('end', () => {
  main(input.split(/\r?\n/));
});

var main = (lines) => {
  var array = [];
  var max = 0;
  for(var i=1; i<lines.length; i++) {
    var found = array.find((e) => {return e.name === lines[i];});
    if(found === undefined) {
      found = {'name':lines[i],'count':1};
      array.push(found);
    }
    else {
      found.count++;
    }
    if(found.count > max) {
      max = found.count;
    }
  }
  array.filter((e) => {return e.count === max;}).map((e) => {return e.name;}).sort().forEach((e) => {console.log(e);});
}