#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> mymap;
  map<string, int>::iterator it;
  int n, max;
  string line;
  max = 0;
  scanf("%d\n", &n);
  for (int i = 0; i < n; i++) {
    cin >> line;
    it = mymap.find(line);
    if (it == mymap.end()) {
      mymap[line] = 1;
      if (1 > max) max = 1;
    } else {
      (*it).second++;
      if ((*it).second > max) max = (*it).second;
    }
  }
  for (it = mymap.begin(); it != mymap.end(); it++)
    if ((*it).second == max) {
      printf("%s", (*it).first.c_str());
      break;
    }
  return 0;
}
