2017.11.24
#include<iostream>
#include<map>
using namespace std;
map<string, int> balloons;
map<string, int>::iterator it;
int main(){
int n;
string color;
int maxn = 0;
string ans;
cin >> n;
while(n != 0){
while(n--){
cin >> color;
balloons[color] += 1;
}
it = balloons.begin();
maxn = 0;
for(; it != balloons.end(); it++){
if(it->second > maxn){
maxn = it->second;
ans = it->first;
}
}
cout << ans << endl;
balloons.clear();
cin >> n;
}
return 0;
}