#include<iostream> #include<cstdio> #include<cstring> using namespace std; int main() { string str; cin >> str; int count = 0, i = 0; char temp; bool flag[str.size()]; for (int i = 0; i < str.size(); ++i)flag[i] = false; while (i < str.size()) { for (; i < str.size(); ++i) { if (flag[i]==false) { temp = str[i]; break; } } for (int k = i; k < str.size(); ++k) { if (str[k] == temp && flag[k] == false) { ++count; flag[k] = true; if (count == 2) { cout << temp << ":" << i << "," << temp << ":" << k; } if (count > 2) { cout << "," << temp << ":" << k; } } } if(count>=2)cout<<endl; count=0; ++i; } return 0; }