#include #include int main() { int i = 0; int length = 0; int rem; int count = 0; char line[13]; scanf("%s",line); length = strlen(line); if(length % 3 == 2) { printf("%c%c,", line[i], line[i + 1]); rem = 2; } else if(length % 3 == 1) { printf("%c,", line[i]); rem = 1; } else if(length % 3 == 0) { printf("%c%c%c,", line[i], line[i + 1], line[i + 2]); rem = 3; } for(i = rem;i < length;i++) { count++; printf("%c",line[i]); if(count % 3 == 0 && i != length - 1) printf(","); } return (0); }