#include<stdio.h> #include<string.h> #include<map> #include<iostream> using namespace std; int main() { int n; map<char*,int> m; char res[16]; int max; char color[16]; while(1) { cin>>n; if(n==0) break; max=0; for(int i=0;i<n;i++) { cin>>color; m[color]++; if(m[color]>max) strcpy(res,color); } cout<<res<<endl; } }