#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<string, int> result;
  string scored_team;
  for (int i = 0; i < n; i++) {
    cin >> scored_team;
    result[scored_team]++;
  }
  map<string, int>::key_compare comp = result.key_comp();
  string l = result.rbegin()->first;
  map<string, int>::iterator it = result.begin();
  string ans;
  int max = 0;
  do {
    ;
    if (it->second > max) {
      max = it->second;
      ans = it->first;
    }
  } while (comp((*it++).first, l));
  cout << ans << endl;
  return 0;
}
