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