"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0]);
    const S = arg.slice(1, N + 1).sort();
    
    let list = [];
    let streak = 0;
    let max = 0;
    
    for(let i=0; i<S.length; i++) {
        if(S[i] === S[parseInt(i) + 1]) {
            streak++;
        } else {
            streak = 0;
        }
        
        if(streak > max) {
            max = streak;
            list = [S[i]];
        } else if(streak === max) {
            list.push(S[i]);
        }
    }
    
    console.log(list.join("\n"));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));