#include<stdio.h>
#include<stdlib.h>
typedef struct node
{
    int data;
    struct node *next;
    struct node *prev;
}node;
node *head=NULL,*tail;
void create(int num)
{
    node *newnode=(node*)malloc(1*sizeof(node));
    newnode->data=num;
    newnode->next=NULL;
    newnode->prev=NULL;
    if(head==NULL)
    {
        head=newnode;
        tail=newnode;
    }
    else
    {
        newnode->prev=tail;
        tail->next=newnode;
        tail=newnode;
    }
}
void display()
{
    node *it;
    for(it=tail;it!=head->prev;it=it->prev)
    {
        printf("%d ",it->data);
    }
}
int main()
{
    int s,n,i'
    scanf("%d",&s);
    if(s<0)
    {
        printf("Invalid input");
        return 0;
    }
    for(i=0;i<s;i++)
    {
        scanf("%d",&n);
        create(n);
    }
    display();
    return 0;
}