// editor4
#include<stdio.h>
#include<stdlib.h>
struct Node{
    int data;
    struct Node *next;
};
struct Node* createNode(int value){
    struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
    newNode->data = value;
    newNode->next = NULL;
    return newNode;
}
void insertEnd(struct Node **head, int value){
    struct Node *newNode = createNode(value);
    if(*head == NULL){
        *head = newNode;
        return;
    }
    struct Node *temp = *head
    while (temp->next != NULL)
        temp = temp->next;
    temp->next = newNode;
}
void traversiList(struct Node *head){
    struct Node *temp = head;
    while(temp != NULL){
        printf("%d ", temp->data);
        temp = temp->next;
    }
    printf("\n");
}
int main(){
    int n, value;
    struct Node *head = NULL;
    if(scanf("%d", &n) != 1){
        printf("Invalid Input\n");
        return 0;
    }
    if(n < 0){
        printf("Invalid Input\n");
        return 0;
    }
    for (int i=0;i<n;i++){
        if(scanf("%d", &value) != 1){
            printf("Invalid Input\n");
            return 0;
        }
        insertEnd(&head, value);
    }
    traverseList(head);
    return 0;
}