//map做法http://blog.youkuaiyun.com/asure__cpp/article/details/8727340
#include<iostream>
#include<map>
#include<string>
using namespace std;
int main()
{
int n, i;
map<string, int>m;
while(scanf("%d", &n) != EOF && n)
{
m.clear();
string color, maxcolor;
int max = 0;
while(n--)
{
cin >> color;
m[color]++;
}
map<string, int>::iterator m_Iter;
for( m_Iter = m.begin(); m_Iter != m.end(); m_Iter++ )
{
if(max < m_Iter->second)
max = m_Iter->second, maxcolor = m_Iter->first;
}
cout << maxcolor << endl;
}
return 0;
}