////////////////////////////////////////////////////////////////////////////////////////////////////
//自虐玩法 256个ASCII挨个遍历,用上了队列!!!!自杀式玩法,答案缺个排序
////////////////////////////////////////////////////////////////////////////////////////////////////
#include <iostream>
#include <cstdio>
// #include <algorithm>
#include <string>
// #include <cstring>
#include <queue>
using namespace std;
const int MAXSIZE = 256;
// const int length = 100;
// int number[MAXSIZE];
// const int MAXSIZE = 100;
// struct ALPHA{
// char str1;
// int pos[MAXSIZE];
// int number;
// };
struct ALPHA
{
char str1;
// int pos[length];
int number;
queue<int> pos;
};
ALPHA alpha[MAXSIZE];
int main()
{
string str; //sting str;不是数组;一个串,是一个文件;放里边
while(getline(cin,str))
{
// int j[length];
// memset(j,0,length);
for(int i=0; i<str.size(); ++i)
{
// number[i]++;
// number[str[i]-' ']++;
alpha[str[i]].str1=str[i];
alpha[str[i]].number++;
// alpha[str[i]].pos[++j[str[i]]]=i;
alpha[str[i]].pos.push(i);
}
// for(int i=0; i<MAXSIZE; ++i)
// {
// printf("%d ",alpha[i].number);
// }
// memset(j,0,MAXSIZE);
for(int i=0; i<MAXSIZE; ++i)
{
if(alpha[i].number>1)
{
for(int p=0; p<alpha[i].number; ++p)
{
printf("%c:%d",alpha[i].str1,alpha[i].pos.front());//front是访问队头,不删除!!!!!
alpha[i].pos.pop();//这个才是删除队头呢!!!!!!!!!!!!!
// printf("%c:",alpha[i].str1);
if(p!=alpha[i].number-1)
{
printf(",");
}else{
printf("\n");
}
}
}
}
}
}
// while(getline(cin,str)){
// for(int i=0;i<str.size();++i){
// printf("\n");
// }
// int i;
// if(alpha[i].number>1){
// for(int j=0;j<alpha[i].number;++j){
// printf("%c:%d",alpha[i].str1,alpha[i].pos);
// if(j==alpha[i].number-1){
// printf(",");
// }
// }
// }
// }
// }
// printf("%d ",number[i]);