function Main(input) {
	var line = input.split('\n');
	var n = parseInt(line[0], 10);
	line.sort();
	var count = 1;
	var anser = new Array();
	var anserN = new Array();
	anser.push(line[1]);
	for(var i=2; i<n+1; i++){
		if(line[i] == line[i-1]){
			count++;
		}else{
			anser.push(line[i]);
			anserN.push(count);
			count = 1;
		}
	}
	anserN.push(count);
	var max = 0;
	for(var i=0; i<anserN.length; i++){
		if(anserN[i] > max){
			max = anserN[i];
		}
	}
	var ans = new Array();
	for(var i=0; i<anserN.length; i++){
		if(anserN[i] == max){
			ans.push(anser[i]);
		}
	}
	for(var i=0; i<ans.length; i++){
		console.log(ans[i]);
	}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));