#include <iostream> #include <string> using namespace std; int main() { string inpt; while(cin>>inpt){ int outindex[100]={0}; int i=0; while(i<inpt.size()){ int f=1; if (outindex[i]==1) { i++; continue; } outindex[i]=1; for(int j=i+1;j<inpt.size();j++){ if(inpt[i]==inpt[j]) { outindex[j]=1; if(f==1) { cout<<inpt[i]<<':'<<i; f=0;} cout<<','<<inpt[j]<<':'<<j; } } if(f==0) cout<<endl; i++; } } }