'use strict';
const 
    fs = require('fs'),
    input =  fs.readFileSync('/dev/stdin', 'UTF-8').split('\n');
let obj = {}, arr=[];
for(let i=1; i<=Number(input[0]); i++){
    if(!obj[input[i]])
        obj[input[i]] = 1;
    else
        obj[input[i]]++;
}
for(let s in obj)
    arr.push([s, obj[s]]);
arr = arr.sort((a, b)=>{
    if(a[1] != b[1])
        return b[1] - a[1];
    return (b[0] < a[0]) - (a[0] < b[0]);
}).filter(s => s[1]==arr[0][1]);

for(let s of arr)
    console.log(s[0]);