#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
typedef struct Node
{
    int data;
    struct Node*prev;
    struct Node*next;
} Node;
Node*createNode(int data)
{
    Node*newNode=(Node*)malloc(sizeof(Node));
    if (!newNode)
    {
        printf("Memory allocation error\n");
        exit(1);
    }
    newNode->data=data;
    newNode->prev=NULL;
    newNode->next=NULL;
    return newNode;
}
void insertEnd(Node**head,int data)
{
    Node*newNode=createNode(data);
    if(*head==NULL)
    {
        *head=newNode;
        return;
    }
    Node*temp=*head;
    while(temp->next!=NULL)
    {
        temp=temp->next;
    }
    temp->next=newNode;
    newNode->prev=temp;
}
void printList(Node*head)
{
    Node*temp=head;
    while(temp!=NULL)
    {
        printf("%d",temp->data);
        temp=temp->next;
    }
    printf("\n");
}
int main()
{
    int n;
    if(scanf("%d",&n)!=1 || n<=0)
    {
        printf("Invalid input\n");
        return 0;
    }
    insertEnd(&head, val);
}
printList(head);
return 0;
}