function Main(input) {
	input = input.split("\n");
	input.shift();
	var arr = [];
	for(var i=0;i<input.length;i++){
		if(arr[input[i]]){
			arr[input[i]]++;
		}else{
			arr[input[i]] = 1;
		}
	}
  //console.log(arr)
  var max = [0,""];
   Object.keys(arr).forEach(function(key){
		 if(max[0]<=arr[key]){max[0]=arr[key]; max[1]=key;}
	 });
	 var ans = [];
	 Object.keys(arr).forEach(function(key){
		 if(max[0]==arr[key]){ans.push(key)}
	 });
	 ans = ans.sort();
	 console.log(ans.join("\n"))
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
