#include <stdio.h>
#include <stdlib.h>

typedef struct Node{
    int data;
    struct Node *next;
} Node;

Node* read_item(){
    int in = 0;
    if (scanf("%d", &in) != 1)
        return NULL;
    Node * new_item = (Node *)calloc(1,sizeof(Node));
    new_item->data = in;
    return new_item;
}

void read_list(Node **head){
    if(*head == NULL)
        *head = read_item();

    Node * last_item = *head;
    Node * item = NULL;
    while((item = read_item())){
        last_item->next = item;
        last_item = item;
    }
}

void print(Node *head){
    Node *p;
    p = head;
    if (!p) printf("The list is empty\n");
    while(p){
        printf("out: %d\n", p->data);
        p = p->next;
    }
}

int main(){
    Node *head = NULL;
    read_list(&head);
    print(head);
    
    int pause;
    scanf("%d", &pause);
}