#include <iostream>
#include <string>
#include <vector>
using namespace std;
struct record{
    int count;//记录次数,如果次数大于1则输出
    vector<int> pos;//记录在string中出现的位置
    bool isprinted;//避免重复输出
};

int main() {
    vector<record> hash(128,{0, {},false});
    string str;
    while(cin>>str){
        for(int i=0;i<str.size();i++){
            hash[str[i]].count++;
            hash[str[i]].pos.push_back(i);
        }
        for(char i:str){
            if(hash[i].count>1&&hash[i].isprinted==false){
                cout<<i<<":"<<hash[i].pos[0];//处理中间需分隔的输出,一般可以先输出第一个。
                for(int j=1;j<hash[i].pos.size();j++){
                    cout<<","<<i<<":"<<hash[i].pos[j];
                }
                hash[i].isprinted=true;
                cout<<endl;
            }
        }
    }
    return 0;
}