#include <iostream>
#include<string>
#include<cstring>
using namespace std;
struct WordList
{
char word[20];
int freq;
};
int main()
{
WordList list[1000];
int N = 0;
int i,j,k;
char tmp[20];
cin>>tmp;
while(strcmp(tmp,"xyz") != 0)
{
for(i = 0 ; i < N ; i++)
{
if(strcmp(list[i].word , tmp) == 0)
{
list[i].freq++;
break;
}
}
if(i >= N)
{
strcpy(list[i].word , tmp);
list[i].freq = 1;
N++;
}
cin>>tmp;
}
for(i = 0 ; i < N - 1 ; i++)
{
k = i;
for(i = i + 1 ; j < N ; j++)
{
if(strcmp(list[j].word , list[k].word) < 0)
{
k = j;
}
}
if(k != j)
{
WordList tmp;
tmp = list[i];
list[i] = list[k];
list[k] = tmp;
}
}
cout<<"统计结果如下:"<<endl;
for(i = 0 ; i < N ; i++)
{
cout<<list[i].word<<"\t"<<list[i].freq<<endl;
}
return 0;
}