#include <iostream>
#include <string>
#include <stack>
using namespace std;

int main() {
    string s;
    cin>>s;
    stack<char> st;
    int count=0;
    //将字符串从末尾遍历,压入栈中
    for(int i=s.size()-1;i>=0;i--){
        st.push(s[i]);
        count++;
        if(count==3&&i!=0){
            st.push(',');
            count=0;
        }
    }     
    string res;
    while(st.size()){
        res+=st.top();
        st.pop();
    }
    cout<<res<<endl;

   return 0;
}
// 64 位输出请用 printf("%lld")