/*#include <stdio.h>
#include<string.h>
int stack[200]={};
int stack2[200]={};
int stack3[200]={};
int top=-1, top2=-1, top3=-1;
void push(int data)
{
top++;
stack[top]=data;
}
void push2(int data)
{
top2++;
stack2[top2]=data;
}
void push3(int data)
{
top3++;
stack3[top3]=data;
}
int pop()
{
if (top==-1){
return 0;
}
return stack [top--];
}
int pop2()
{
if (top2==-1){
return 0;
}
return stack2[top2--];
}
int pop3()
{
if (top3==-1){
return -1;
}
return stack3[top3--];
}
int main()
{
char str[100]={}, str2[100]={};
int i, sum=0, a, c=0;
gets (str);
gets (str2);
for (i=0; i<100 ; i++){
if (str[i]!=NULL){
push(str[i]-'0');
}
if (str2[i]!=NULL){
push2(str2[i]-'0');
}
}
for (;;){
sum=pop()+pop2()+c;
c=sum/10;
push3(sum%10);
if (top==-1&&top2==-1){
break;
}
}
if (c==1){
push3(c);
}
while (top3!=-1){
printf ("%d", pop3());
}
return 0;
}
*/
#include<stdio.h>
#include<string.h>
int stack[200]={};
int top=-1;
void push()
{
}
int pop()
{
}
int main()
{
char str[200]={};
int sum=0, i;
gets (str);
for (i=0; str[i]!=NULL; i++){
if (str[i]>47&&str[i]<58){
sum=sum*10+str[i];
}
if (str[i]==' '){
sum=0;
}
if (sum!=0){
push(str[i]-'0');
}
if (str[i])
}
}