#include <stdio.h>
#include<math.h>
#include<string.h>
int main() {
char str[100];
while (scanf("%s", str) != EOF) {
int len = strlen(str);//求出输入字符串长度
int position[len];//标记是否相同字符
int i, j;
for (i = 0; i < len; i++) {
position[i] = 0;//初始化
}
for (i = 0; i < len; i++) {
for (j = i + 1; j < len; j++) {
if (str[i] == str[j]) {//具有相同字符则填1
position[i] = 1;
position[j] = 1;
}
}
}
for (i = 0; i < len; i++) {
if (position[i]) {//判断是否后面有字符与它相同
printf("%c:%d", str[i], i);
for (j = i + 1; j < len; j++) {
if (str[i] == str[j]) {//找出与前面相同的字符
printf(",");
printf("%c:%d", str[j], j);//输出
position[j] = 0;//将其置为0,防止之后再输出
}
}
printf("\n");
}
}
}
return 0;
}