#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(NULL);
  cin.tie(NULL);
  ;
  map<string, long long> mp;
  long long n;
  cin >> n;
  long long c = -1;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    mp[s]++;
    c = max(c, mp[s]);
  }
  for (auto it : mp) {
    if (c == it.second) {
      cout << it.first;
      break;
    }
  }
}
