#include<stdio.h>
#include<math.h>
int main()
{
long long n,i,high;
int k,d=0,count=0,j,len;
scanf("%lld",&n);
i=n;
for(len=0;i!=0;len++)
i=i/10;
k=len;
if(n==0)
printf("%lld\n",n);
if(len%3==0)
{
for(j=1;j<=k;j++)
{
high=n/(long long)(pow((long long)10,(long long)len-1));
printf("%lld",high);
n=n%(long long)(pow((long long)10,(long long)len-1));
count++;
len--;
if(count%3==0&&j!=k)
printf(",");
if(j==k)
printf("\n");
}
}
d=len%3,high=0,count=0;
if(d!=0)
{
for(j=1;j<=k;j++)
{
high=n/(long long)(pow((long long)10,(long long)len-1));
printf("%lld",high);
n=n%(long long)(pow((long long)10,(long long)len-1));
count++;
len--;
if(count==d&&j!=k)
{
printf(",");
count=0;
d=3;
}
if(j==k)
printf("\n");
}
}
return 0;
}