#include<stdio.h>
#include<stdlib.h>

struct Node{
    int data;
    struct Node *next;
};

struct Node* insert(struct Node *head, int value){
    struct Node *newNode = (struct Node*)malloc(sizeof(struct Node));
    newNode->data=val;
    newNode->next=NULL;
    
    
    if(head == NULL){
        return newNode;
        
        struct Node *temp = head;
        while(temp->next != NULL)
        temp = temp->next;
        
        temp->next = newNode;
        return head;
    }
    
    void traverse(struct Node *head){
        struct Node *temp = head;
        
        if(temp == NULL)
        return;
        
       printf("%d", temp->data);
       temp = temp->next;
       
       while(temp != NULL){
           printf(" %d", temp->data);
           temp = temp->next;
       }
    }
    int main(){
        int n, i, val;
        struct Node *head = NULL;
        
        if(scanf("%d", &n) != 1){
            printf("Invalid Input");
            return 0;
        }
        head = insert(head,val);
    }
    
    traverse(head);
    return 0;
}