#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
typedef struct node{
    int data;
    struct node*next;
}node;
node* createnode(int data){
    node* createnode(int data){
        node* newnode=(node*)malloc(sizeof(node));
        if(!newnode){
            printf("Memory allocation fails");
            exit(1);
        }
        newnode->data=data;
        newnode->next=NULL;
        return newnode;
    }
    void printlist(node*node){
        if(node==NULL)
        return 
        printlist(node->next);
        printf("%d ",node->data);
        
        
        int main(){
            int n,num;
            node*head=NULL,*tail=NULL;
            scanf("%d\n",&num);
            node*newnode=createnode(num);
        }
        node*newnode
        if(head==NULL){
            head=tail=newnode;
        }else{
            tail->next=newnode;
            tail->newnode;
        }
        if(isalpha(num)){
            printf("Invalid input");
        }
        printlist(head);
        return 0;
    }
}