#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int top = -1;
char *stack;
void pop(char* s);
void push(char* s, int n,int z);
int main() {
int n,z;
char* s;
scanf("%d", &n);
if (n / 3 != 0 && n % 3 != 0) {//콤마의 갯수를 구하여 정의해준다.
z = n / 3;
}
else
z = 0;
stack = (char*)malloc(z+n * sizeof(char));
s = (char*)malloc(z + n * sizeof(char));
scanf("%s", s);
push(s, n, z);
pop(s);
}
void push(char* s, int n,int z) {
for (int i = 1; i <= n+z; i++) {
top++;
if (i % 4 == 0) {
stack[top] = ',';
}
else {
stack[top] = s[n - i];
}
}
}
void pop(char* s) {
while (top >= 0) {
printf("%c", stack[top--]);
}
}