#include <iostream> #include <cstdio> #include <string> #include <vector> using namespace std; int main() { string str; while (cin>>str) { bool flag[str.length()]; for (int i = 0; i < str.length(); i++) { flag[i] = false; } for (int i = 0; i < str.length(); i++) { if (flag[i]) { continue; } else { flag[i]=true; vector<int> myVecto; myVecto.push_back(i); for (int j = i + 1; j < str.length(); j++) { if (str[i] == str[j]) { flag[j]=true; myVecto.push_back(j); } } if (myVecto.size() > 1) { for (int k = 0; k < myVecto.size()-1; k++) { cout << str[i] << ":" << myVecto[k]<<","; } cout<<str[i]<<":"<<myVecto[myVecto.size()-1]<<endl; } } } } return 0; } // 64 位输出请用 printf("%lld")