#include <bits/stdc++.h>
using namespace std;
long long int max(long long int a, long long int b) {
  if (a > b) return a;
  return b;
}
long long int min(long long int a, long long int b) {
  if (a < b) return a;
  return b;
}
const long long int MOD = 1e9 + 7, N = 2e5 + 5, INF = 1e9, M = 1e6;
int a[N];
std::vector<int> v;
bool ch[N], ch2[N];
int bin_p(int n, int m) {
  int tp = 1, ans = 0;
  while (m > 1) {
    if (m & 1) {
      m /= 2;
      tp *= n;
      tp %= 10;
    } else
      m /= 2;
    n *= n;
    n %= 10;
  }
  n *= tp;
  n %= 10;
  return n;
}
int main() {
  int t = 1;
  while (t--) {
    map<string, int> m;
    int n;
    cin >> n;
    string tp;
    for (int i = 0; i < n; i++) {
      cin >> tp;
      m[tp]++;
    }
    int mx = 0;
    for (auto aa : m) {
      mx = max(aa.second, mx);
    }
    for (auto aa : m) {
      if (aa.second == mx) {
        cout << aa.first << "\n";
        return 0;
      }
    }
  }
  return 0;
}
