#include<iostream>
using namespace std;
struct BTree
{
char value[35];
int num;
struct BTree *lchild;
struct BTree *rchild;
};
void insert_node(BTree* &root,char *s1)
{
if(root==NULL)
{
root=new BTree;
strcpy(root->value,s1);
root->lchild=NULL;
root->rchild=NULL;
root->num=1;
return ;
}
if( strcmp(root->value,s1) ==0 )
{
root->num++;
return ;
}
if(strcmp(root->value,s1)>0)
{
insert_node(root->lchild,s1);
}
else
insert_node(root->rchild,s1);
}
void print(BTree *root,double total)
{
if(root==NULL)
return ;
print(root->lchild,total);
cout<<root->value<<" ";
printf("%.4lf\n",(double)root->num/total *100);
print(root->rchild,total);
}
int main()
{
char s1[35];
BTree * root=NULL;
double total=0;
while(gets(s1))
{
insert_node(root,s1);
total++;
}
print(root,total);
return 0;
}