#include <stdio.h>
#include<stack>
#define CRTSECURE_NO_WARNING_
char stack[500]={};
int top=-1, a;
int c=0;
int main(){
char num[201]={};
scanf("%d", &a);
scanf("%s", num);
for(int i = a-1; i>=0; i--){
top++;
stack[top]=num[i];
c++; // 숫자가 몇번 push 되었는지 세기
if(c % 3 == 0 && i!=0){
top++;
stack[top]=',';
}
}
while(top!=-1)
{
printf("%c", stack[top]);
top--;
}
}



