#include <iostream>
#include <map>
#include <string>
#include <algorithm>
using namespace std;
int main(void)
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int N, i, max_book = 0;
string name;
map<string ,int> book;
cin >> N;
for (i = 0; i < N; i++)
{
cin >> name;
book[name]++;
}
for (auto p : book)
{
max_book = max(max_book, p.second);
}
for (auto p : book)
{
if (p.second == max_book)
{
cout << p.first;
break;
}
}
return 0;
}