#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
struct Node{
   int data;
   struct Node*prev;
   struct Node*next;
};
    {
    struct Node newNode=(struct Node)malloc(sizeof(struct Node));
    newNode->data=value
    newNode->next=NULL;
    newNode->prev=NULL;
    
    if(*head==NULL){
    *head=newNode;
    return;
    }
    
     struct Node*temp=*head;
     while(temp->next!=NULL)
       temp=temp->next
       
       temp->next=newNode
       newNode->prev=temp;
    }
    
int main(){
   intn;
   
   if(scanf("%d,&n) !=1||n<=0){
   printf("invalid input");
   return0;
    }
    
    struct Node *head=Null;
    for (int i=0;i<n;i++){
    int id;
    if(scanf("%d",&id) !=1){//invalid inout
    printf("invalid input");
    return0;
    }
    if(id<-10000||id>10000){//out of constraint
    printf("invalid input");
    return0;
    }
     append(&head,id);
    }
    
    //Print list
    struct Node *temp=head;
    while(temp!=NULL){
        printf("%d",temp->data);
        if(temp->next!=NULL)print("")
        temp=temp->next;
    }
    
    return0;
    }
    }