// editor2
#include<stdio.h>
#include<stdlib.h>
struct Node {
    int data;
    struct Node*prev;
    struct Node*next;
};
void append(struct Node**head,int value) {
    struct Node*newcode=(struct Node*)malloc(sizeof(struct Node));
    newNode -> data = value;
    newNode -> next  = NULL;
    return;
}
struct node*temp=*head;
while(temp->next !=NULL) {
    temp=temp->next;
}
temp->next=newNode;
newNode->prev=temp;
}
int main(){
    int n,,value;
    scanf("%d", &n);
    return 0'
}
struct Node*head=NULL;
for (int i=0;i<n;i++){
    if (scanf("%d", &value)!=1 || value <-10000 || value >10000){
        printf("Invalid input\n");
        return o;
    }
    append(&head,value);
}
struct Node*temp=head;
while(temp !=NULL){
    printf("%d",temp->data);
    temp=temp->next;
}
printf("\n");
return 0;