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