#include <bits/stdc++.h>
using namespace std;

int main(){
	int n, maxi =0;
	cin >> n;
	map<string,int> m;
	while(n--){
		string s;
		cin >> s;
		m[s]++;
		maxi = max(maxi,m[s]);

	}
	for(auto const& x: m){
		if (x.second == maxi) cout << x.first << endl;
	}
	
 }
