inp = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n')
N = inp.shift() * 1
o = {}
max = 0
for (i=0; i<N; i++) {
    if (!o[inp[i]]) {
        o[inp[i]] = 1
    } else {
        o[inp[i]] += 1
    }
    if (max < o[inp[i]]) {
        max = o[inp[i]]
    }
}
k = Object.keys(o)
k = k.filter((k) => o[k] == max)
console.log(k.sort().join("\n"))
