#include<bits/stdc++.h>

using namespace std;

int main() {
  	int n;
  	cin >> n;
  	map<string, int> mp;
  	int mx = 0;
  	for (string s; n--;) {
      	cin >> s;
      	mp[s]++;
      	mx = max(mx, mp[s]);
    }
  	for (auto x : mp) {
      	if (x.second == mx) {
          	cout << x.first << "\n";
        }
    }
  	return 0;
}