#include<iostream>
#include<map>
#include<string>
using namespace std;
typedef map<string,int> Type;
string findcolor(Type &color)
{
int max = 0;
string c;
Type::iterator it;
for(it = color.begin();it!= color.end();it++)
{
if((*it).second > max)
{
max= (*it).second;
c = (*it).first;
}
}
return c;
}
int main()
{
map<string, int> color;
map<string, int>::iterator it;
string tmp;
int N;
cin>>N;
while(N!=0)
{
while(N!=0)
{
cin>>tmp;
it = color.find(tmp);
if(it == color.end())
{
color.insert(pair<string,int>(tmp,1));
}
else
{
(*it).second++;
}
N--;
}
cout<<findcolor(color)<<endl;
color.clear();
cin>>N;
}
getchar();
getchar();
}