#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>

typedef struct Node { 
    int data;
    struct Node*next;
}Node;
Node*createNode(int data){
    Node* newNode = (Node*)malloc(sizeof(Node));
    if(!newNode){
        printf("Memoryt error\n");
        return NULL;
        return newNode;
    }
    void insert(Node**head,int data0 {
        Node* new Node = createMode(data);
        if(*head==NULL) {
            *head = newNode;
    }else {
        node*temp=*head;
        while (temp->next) {
            temp = temp->next;
        }
        temp->next=newNode;
    }
}
void printList(Node* head) {
    while (head) {
        printf("%d",head->data);
        head = head->next;
    }
    printf("\n");
}

int main() {
    int ;
    if(scanf("%d",&n)!= 1 ||n < - 10 || n > 10) {
        printf("Invalid input\n");
        return 0;
    }
    
    if(n < 0) {
        printf("Invalid input\n");
        return 0;
}

Node*head=NULL;
for(int i = 0; i < m; i++) {
    int id;
    if(scanf("%d",&id) != 1){
        printf("Invalid input\n");
        return 0;
    }
    insert(&head,id);
}
printList(head);
return 0;
}