#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
int h[N], e[N], ne[N], idx;
void add(int a, int b){
e[idx] = b;
ne[idx] = h[a];
h[a] = idx ++;
}
int main(){
string str;
while (cin >> str) {
unordered_map<char, int> mp;
for (int i=0; i<str.size(); i++){
mp[str[i]] ++;
}
vector<string> res;
bool st[110];
for (int i=0; i<110; i++){
st[i] = false;
}
for (int i=0; i<str.size(); i++){
if (st[i] == true){
continue;
}
if (mp[str[i]] > 1){
char tmp = str[i];
for (int j=i; j<str.size(); j++){
if (str[j] == tmp){
st[j] = true;
if (mp[str[i]] == 1)
cout << tmp << ":" << j;
else
cout << tmp << ":" << j << ",";
mp[str[i]] --;
}
}
puts("");
}
}
}
return 0;
}