#include <bits/stdc++.h>
using namespace std;
string most_occurred(const vector<std::string> &vec) {
  map<string, unsigned long> str_map;
  for (const auto &str : vec) ++str_map[str];
  typedef decltype(pair<string, unsigned long>()) pair_type;
  auto comp = [](const pair_type &pair1, const pair_type &pair2) -> bool {
    return pair1.second < pair2.second;
  };
  return max_element(str_map.cbegin(), str_map.cend(), comp)->first;
}
int main() {
  int n;
  cin >> n;
  string s;
  vector<string> a;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    a.push_back(s);
  }
  cout << most_occurred(a);
}
