#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int n, count = 1, temp = 1, idx;
  cin >> n;
  string goal[n];
  if (n == 1) {
    string s;
    cin >> s;
    cout << s << endl;
  } else {
    for (long long int i = 0; i < n; i++) {
      long long int a = 5;
      cin >> goal[i];
    }
    for (long long int i = 0; i < n; i++) {
      for (long long int j = i + 1; j < n; j++) {
        if (goal[i] == goal[j]) {
          temp++;
          if (temp > count) {
            count = temp;
            idx = i;
          }
        }
      }
      temp = 1;
    }
    cout << goal[idx];
  }
  return 0;
}
