#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  auto m = map<string, int>();
  string ans;
  int score = 0;
  for (auto i = 0; i < n; ++i) {
    string s;
    cin >> s;
    auto sc = ++m[s];
    if (sc > score) {
      score = sc;
      ans = s;
    }
  }
  cout << ans << endl;
  return 0;
}
