#include <bits/stdc++.h>

using namespace std;

typedef long long int64;
typedef vector<int64> vi;
typedef pair<int, int> pii;

const int oo = 0x3f3f3f3f;
const double pi = acos(-1);
const double eps = 1e-9;

#define endl '\n'


int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int n;
	cin >> n;

	map<string, int> m;
	vector<string> S(n);

	vector<string> ans;
	int mx = 0;

	for (int i = 0; i < n; ++i){
		cin >> S[i];
		m[S[i]]++;

		if (m[S[i]] > mx){
			ans = vector<string>();
			mx = m[S[i]];
		}
		if (m[S[i]] == mx){
			ans.push_back(S[i]);
		}
	}

	sort(ans.begin(), ans.end());
	for (int i = 0; i < ans.size(); ++i)
		cout << ans[i] << endl;

	return 0;
}