#include<stdio.h>
int main(){
long long int n;
scanf(“%lld”,&n);
int reverse = 0;
int counter = 0;
int last_digit;
while(n!=0){
last_digit = n%10;
reverse = reverse * 10 + last_digit;
n/=10;
counter++;
}
while(reverse!=0){
last_digit = reverse%10;
printf("%d",last_digit);
reverse/=10;
counter--;
if(counter > 0 && counter%3 == 0){
printf(",");
}
}
return 0;
}