#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int i;
  map<string, int> mp;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    mp[s]++;
  }
  int mx = INT_MIN;
  for (auto it = mp.begin(); it != mp.end(); it++) {
    if (it->second > mx) {
      mx = it->second;
    }
  }
  string ans;
  for (auto it = mp.begin(); it != mp.end(); it++) {
    if (mx == it->second) {
      ans = it->first;
    }
  }
  cout << ans << endl;
}
