// // main.cpp // largeNumberSort // // Created by richard on 9/9/15. // Copyright (c) 2015 luxin. All rights reserved. // #include <iostream> #include <map> #include <string>
using namespace std;
int main(){ // freopen("/Users/RichardLu/Code/C++/Algorithm/largeNumberSort/largeNumberSort/largeNumberSort/testcase.in", "r", stdin); // freopen("/Users/RichardLu/Code/C++/Algorithm/largeNumberSort/largeNumberSort/largeNumberSort/testcase.out", "w", stdout); map<string, int> string_int_map; string a; int count = 0; while (cin >> count&&count) { string_int_map.clear(); while (count--) { cin >> a; string_int_map[a]++; } string most = ""; for (map<string, int>::iterator it = string_int_map.begin(); it != string_int_map.end(); ++it) { if (it->second > string_int_map[most]) { most = it->first; } } cout <<most<<endl; } // fclose(stdin); // fclose(stdout); return 0; }