#include <bits/stdc++.h>
using namespace std;
unordered_map<string, int> m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, max = 0;
  cin >> n;
  string s[n];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    m[s[i]]++;
    int f = m[s[i]];
    if (max < f) max = f;
  }
  sort(s, s + n);
  for (int i = 0; i < n; i++) {
    if (max == m[s[i]]) {
      cout << s[i] << "\n";
      m[s[i]] = 0;
    }
  }
  return 0;
}
