#include <bits/stdc++.h>

using namespace std;

#define ll long long

int main() {
    ll n;
    cin >> n;
    map<string, ll> mp;
    string s;
    while (n--) {
        cin >> s;
        mp[s]++;
    }
    vector<pair<string, ll>> v;
    for (auto it = mp.begin(); it != mp.end(); it++) {
        v.emplace_back(*it);
    }
    sort(v.rbegin(), v.rend(), [](const pair<string, ll> &a, const pair<string, ll> &b) {
       return a.second < b.second;
    });
    auto highest = v.begin();
    auto cur = v.begin();
    while (cur->second == highest->second) {
        cout << cur->first << "\n";
        cur++;
    }
}