#include <bits/stdc++.h>
using namespace std;
int i, n, mx;
string a, b;
map<string, int> s;
int main() {
  scanf("%d", &n);
  while (n--) {
    cin >> a;
    if (++s[a] > mx) {
      b = a;
      mx = s[a];
    }
  }
  cout << b << endl;
  return 0;
}
