#include<stdio.h>
#include<stdlib.h>

struct Node {
    int data;
    struct Node* next;
};

struct  Node* insert(struct Node*head, int data) {
    struct Node* newNode = malloc(sizeof(struct Node));
    newNode->data = data;
    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 display(struct Node* head) {
    struct Node* temp = head;
    while (temp != NULL) {
        printf("%d ", temp->data);
        temp = temp->next;
    }
    printf("\n");
}

int main(){
    int n,data;
    struct Node*head = NULL;
    
    if (scanf("%d", &n) !=1) return 0;

    
    for (int i = 0; i < n; i++) {
        if (scanf("%d", &data) !=1)  return 0;
    }
    head = insert(head, data);
            

    }
    
    
    display(head);
    return 0;
    }