#include<stdio.h>
#include<stdlib.h>
struct Node{
    int data;
    struct Node*next;
};
struct Node* insertEnd(struct Node*head,int value)
{
    struct Node*newNode=(struct Node*)malloc(Sizeof(struct Node));
    newNode->data=value;
    newNode->next=NULL;
    if(head==NULL)
        return newNode;
    struct Node*temp=head;
    while(temp->next!=NULL)
        temp=temp->next;
    temp->next=newNode;
    return head;
}

struct Node* reverselist(struct Node*head)
{
    struct Node*prev=NULL;
    struct Node*current=head;
    struct Node*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;
    }
}

int main()
{
    int n;
    scanf("%d",&n);
    if(n<0)
    {
        printf("Invalid input");
        return 0;
    }
    struct Node*head=NULL;
    int value;
    for(int i=0;i<n;i++)
    {
        scanf("%d",&value);
        head=insertEnd(head,value);
    }
    head=reverselist(head);
    printlist(head);
    return 0;
}