#include <stdio.h>
#include <stdlib.h>
typedef struct Node{
int data;
struct Node *next;
}No;
int main()
{
No *head; //头指针
head=(No*)malloc(sizeof(No));
No *p=head;
int e,i;
for(i=0;i<9999;i++)
{
scanf("%d",&e);
if(e)
{
head->data=e;
head->next=(No*)malloc(sizeof(No));
head=head->next;
}
else break;
}
head->next=NULL;
while(p->next!=NULL)
{
printf("%d",p->data);
p=p->next;
}
return 1;
}