#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    map<string, int> mp;
    string s, w;
    int mx = 0;
    for (int i = 0; i < n; i += 1) {
      cin >> s;
      mp[s]++;
      if (mp[s] > mx) {
        mx = mp[s];
        w = s;
      }
    }
    cout << w << endl;
    mp.clear();
  }
  return 0;
}
