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

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