function main(input) {
  var N = input[0].split(" ")[0]-0;
  var map = {};
  var max = 0;
  for(var i=1;i<=N;i++){
    map[input[i]] = (map[input[i]]||0)+1;
    max = Math.max(max, map[input[i]]);
  }
  Object.keys(map).filter(v=>map[v]==max).sort().forEach(v=>console.log(v));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8').split("\n"))
