/*
#include<stdio.h>
int s[100000], top=-1;
void push(int x)
{
top++;
s[top]=x;
}
int pop()
{
if(top!=-1)
{
top--;
}
return s[top+1];
}
int main ()
{
int k, a, b=0;
scanf("%d", &k);
for(int i=0 ; i<k ; i++)
{
scanf("%d", &a);
if(a!=0)
{
push(a);
}
else
{
pop();
}
}
while(top!=-1)
{
b+=pop();
}
//for(int j=0 ; j<=top ; j++)
//{
//b+=s[j];
//}
printf("%d", b);
return 0;
}
*/
/*
#include<stdio.h>
#include<string.h>
int s[50000]={}, top=-1;
void push(int x)
{
top++;
s[top]=x;
}
void pop()
{
if(top!=-1)
{
top=top-2;
}
}
int main ()
{
char a[50000];
scanf("%s", a);
for(int i=0 ; a[i]!=NULL ; i++)
{
push(a[i]);
if(top>0 && s[top-1]=='(' && s[top]==')')
{
pop();
}
}
if(top==-1)
{
printf("good");
}
else
{
printf("bad");
}
return 0;
}
*/
/*
#include<stdio.h>
char s[500];
int top=-1;
void push(char x)
{
top++;
s[top]=x;
}
int pop()
{
if(top!=-1)
{
top--;
}
return s[top+1];
}
int main ()
{
int n;
char m[201]={};
scanf("%d", &n);
scanf("%s", m);
for(int i=n-1 ; 0<=i ; i--)
{
push(m[i]);
if(top%4==2)
{
push(',');
}
}
while(top!=-1)
{
printf("%c", pop());
}
}
*/