#include <iostream> #include <string> #include <map> using namespace std; int main() { int total; char conver[9] = {'Q','R','S','T','U','V','W','X','Y'}; freopen("input.txt","r",stdin); std::cin>>total; map<string,int> strSet; string in; while(total--) { std::cin>>in; int index=0; char *str=new char[in.size()]; char *res = new char[in.size()]; for(int i=0; i<int(in.size()); i++) { if(in[i]!='-') { if(in[i]>'Q'&&in[i]<'Z') { str[index]=conver[int(in[i]-'Q')-1]; index++; }else { str[index]=in[i]; index++; } } } string newStr; for(int i=0;i<index;i++) { if(i==3) { newStr.append(1,'-'); } if(str[i]>='0'&&str[i]<='9') { res[i]=str[i]; newStr.append(1,res[i]); }else { res[i]=((str[i]-'A')/3+2)+'0'; newStr.append(1,res[i]); } } strSet[newStr]++; } bool flag=true; for (map<string, int>::iterator pos=strSet.begin(); pos!=strSet.end(); ++pos) if (pos->second >1) { std::cout<<pos->first.c_str()<<" "<<pos->second<<std::endl; flag=false;} if (flag) std::cout<<"No duplicates."<<std::endl; return 1; }