#include <iostream>
#include <string>
#include <map>

using namespace std;
map<string,int> mp;
int main(){
	int i,n;
	cin >> n;
	for(i=0;i<n;i++){
		string s; cin >> s;
		mp[s]++;
	}
	int mx = -1;
	for(auto x:mp){
		mx = max(mx,x.second);
	}
	for(auto x:mp){
		if(x.second==mx){
			cout << x.first << endl;
		}
	}
}
			