#include <bits/stdc++.h>
using namespace std;
map<string, int> goles;
int main() {
  int n, aloc = 1, max1 = -1;
  string name, winner, m[100];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> name;
    m[i] = name;
    goles[name] += 1;
  }
  for (int i = 0; i < n; i++) {
    if (goles[m[i]] > max1) {
      max1 = goles[m[i]];
      winner = m[i];
    }
  }
  cout << winner;
  return 0;
}
