#include <bits/stdc++.h>

using namespace std;

int main()
{
	int t; cin >> t;
	map<string, int>arr;

	while (t--) {
		string s; cin >> s;
		arr[s]++;
	}
	int maxv = 0;
	for (auto a : arr) {
		if (a.second > maxv)maxv = a.second;
	}
	for (auto a : arr) {
		if (a.second == maxv) {
			cout << a.first << endl;
		}
	}
	return 0;
}
