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

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