#include<iostream>
#include<string>
#include<map>
#include<fstream>
using namespace std;
int main()
{
ifstream ifs("test.txt");
map<string, int> M;
map<string, int>::iterator iter;
string t;
while(getline(ifs, t))
{
M[t]++;
}
string maxStr;
int max=0;
for(iter = M.begin(); iter != M.end(); iter++)
{
if(iter->second > max)
{
maxStr = iter->first;
max = iter->second;
}
}
cout << maxStr << " " << max << endl;
system("pause");
return 0;
}