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

int main() {
  int n, mx = 0;
  string s;
  cin >> n;
  map<string, int> m;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    ++m[s];
    if (m[s] > mx) mx = m[s];
  }
  for (auto p : m) {
    if (p.second == mx) cout << p.first << endl;
  }
}