#include<bits/stdc++.h>
using namespace std;
int a;
string s;
map<char,int>m;
map<string,int>mm;
int main(){
m['A']=2;
m['B']=2;
m['C']=2;
m['D']=3;
m['E']=3;
m['F']=3;
m['G']=4;
m['H']=4;
m['I']=4;
m['J']=5;
m['K']=5;
m['L']=5;
m['M']=6;
m['N']=6;
m['O']=6;
m['P']=7;
m['R']=7;
m['S']=7;
m['T']=8;
m['U']=8;
m['V']=8;
m['W']=9;
m['X']=9;
m['Y']=9;
cin>>a;
for(int z=0; z<a; z++){
cin>>s;
string ss="";
for(int x=0; x<s.size(); x++){
if(s[x]>='0'&&s[x]<='9'){
ss+=s[x];
}
if(s[z]>='A'&&s[z]<='Z'){
ss+=char('0'+m[s[z]]);
}
}
string h="";
for(int z=0; z<ss.size(); z++){
if(z==3)h+='-';
h+=ss[z];
}
mm[h]++;
}
int o=0;
for(auto it=mm.begin(); it!=mm.end(); it++){
if(it->second>1){
o=1;
cout<<it->first<<" "<<it->second<<endl;
}
}
if(o==0){
cout<<"No duplicates.";
return 0;
}
return 0;
}