'use strict';

function main(input) {
  const args = input.split('\n');
  const strings = args.slice(1);
  const counter = new Map();
  var maxValue = 1;
  for (let string of strings) {
    if (counter.has(string)) {
      let newNumber = counter.get(string) + 1;
      counter.set(string, newNumber);
      if (newNumber > maxValue) {
        maxValue = newNumber;
      }
    } else {
      counter.set(string, 1);
    }
  }
  var ans = [];
  counter.forEach((value, key) => {
    if (value === maxValue) {
      ans.push(key);
    }
  });
  ans.sort();
  console.log(ans);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));