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

int main() {
  int n, ma = 0;
  cin >> n;
  map<string, int> str;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    if (str.count(s)) ++str[s];
    else str[s] = 1;
    if (ma < str[s]) ma = str[s];
  }
  for (auto s : str) {
    if (s.second == ma) cout << s.first << "\n";
  }
}