/*
int i=0;
printf("%d",i++); -> 0이 출력되고, i는 1이 된다.
int i=0;
printf("%d",++i); -> i가 1이 되고 , 1을 출력한다.
#include <stdio.h>
int stack[100000]={};
int top = -1;
int pop()
{
if(top!=-1)
{
return stack[top--];
}
}
void push(int a)
{
stack[++top]=a;
}
int main()
{
int k,a,i,s=0;
scanf("%d",&k);
for(i=1;i<=k;i++)
{
scanf("%d",&a);
if(a!=0)
{
push(a);
}
else
{
pop();
}
}
/*while(top!=-1)
{
s+=pop();
}
printf("%d",s);
return 0;
}
*/
//#include <stdio.h>
//int stack[1001]={};
//int top=-1;
//int pop()
//{
// if(top!=-1)
// {
// return stack[top--];
// }
//}
//void p(int n)
//{
// stack[++top]=n;
//}
//int main()
//{
// int n,i,s=0;
// char str[10000]={};
// scanf("%s",str);
// for(i=0;str[i]!=NULL;i++)
// {
// p(str[i]-'0');
// }
// for(i=0;str[i]!=NULL;i++)
// {
//
// if(top!=-1)
// {
// s=pop();
// }
// printf("%d",s);
// }
//}
#include <stdio.h>
char stack[10000]={};
int top=-1;
char pop()
{
if(top!=-1)
{
return stack[top--];
}
}
void push(char n)
{
stack[++top]=n;
}
int main()
{
char str[1001]={};
int n,a,i,s=0;
scanf("%d %s",&n,str);
//1. 스택에 숫자 push (맨 뒤부터) // 3개 push할때마다
for(i=n-1;i>=0;i--)
{
push(str[i]);
s++;
if(s%3==0)
{
push(',');
}
}
//2. 스택에 있는 숫자 pop 출력
while(top!=-1) //스택에 있는 전부 출력할때는 이렇게 꼭 써주기!!!
{
printf("%c",pop());
}
}