//希望各位朋友不吝赐教,在下感激不尽~
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
//#include<algorithm>
//using namespace std;
char map[26]={'2','2','2','3','3','3','4','4','4','5','5','5','6','6','6','7','Q','7','7','8','8','8','9','9','9','Z'} ;
int Cmp(const void* a, const void* b)
{
return strcmp((char *)a ,(char *)b);
}
int main()
{
int n;
int i;
char str[1000][9];
memset(str,0,sizeof(str));
scanf("%d\n",&n);
for(i=0 ; i<n ; i++)
{
int x=0;
int j;
char buff[1000];
memset(buff,0,sizeof(buff));
scanf("%s",buff);
for(j=0;buff[j]!='\0';j++) //buff[j]
{
if(buff[j]=='-') continue;
if(buff[j]>='A' && buff[j]<='Z') buff[j]=map[buff[j]-'A'];
str[i][x++]=buff[j];
if(x==3) str[i][x++]='-';
}
if(x==8) str[i][x]='\0';
}
qsort( str , n , 9 , Cmp ) ;
//sort(str,str+n-1);
int k=1;
int m;
int flag=1;
for(m=1 ; m<n ; m++)
{
if( strcmp(str[m-1],str[m]) ) //not equal in
{
if(k>1)
{
printf("%s %d\n",str[m-1],k);
flag=0;
}
k=1;
}
else //equal in k++
{
k++;
}
}
if(k>1) {printf("%s %d\n",str[m-1],k); flag=0;}
if(flag) printf("No duplicates.\n");
system("PAUSE");
return 0;
}