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