#include <iostream>
#include <map>
using namespace std;
map<string,int>balloon;
int main()
{
string co,maxco;
int n,m;
while(cin>>n && n)
{
balloon.clear();
while(n--)
{
cin>>co;
balloon[co]++;
}
map<string,int>::iterator it;
m=0;
for(it=balloon.begin();it!=balloon.end();it++)
{
if(it->second > m)
{
m = it->second;
maxco=it->first;
}
}
cout<<maxco<<endl;
}
return 0;
}