#include <iostream>
#include <algorithm>
#include <fstream>
#include <string>
#include <vector>
#include <time.h>
#include <direct.h>
#include <io.h>
#include <stdlib.h>
#include <cassert>
#include <numeric>
#include <functional>
#include <iterator>
#include <map>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
using namespace std;
int main()
{
map<string, int> count;
while (1) {
int a;
cin >> a;
if (a != 0) {
int highestCount = 0;
string highestContent = "";
while (a--) {
string temp;
cin >> temp;
if (count.find(temp) != count.end())
count[temp] += 1;
else
count[temp] = 1;
if (highestCount < count[temp]) {
highestCount = count[temp];
highestContent = temp;
}
}
cout << highestContent << endl;
}
else
break;
}
return 1;
}
杭code1004
最新推荐文章于 2019-08-03 13:53:01 发布