#include<stdio.h>
#include<stdlib.h>
struct node
{
int data;
struct node *next;
}*head;
struct node *creat(int n)
{
struct node *p;
int i;
head = (struct node*)malloc(sizeof(struct node));
head-> next = NULL;
for(i = 1; i <= n; i++)
{
p = (struct node*)malloc(sizeof(struct node));
p-> next = NULL;
scanf("%d", &p-> data);
p-> next = head-> next;
head-> next = p;
}
return head;
}
void print(struct node *head)
{
struct node *p;
p = head-> next;
while(p != NULL)
{
if(p-> next != NULL)
{
printf("%d ", p-> data);
}
else
{
printf("%d\n", p-> data);
}
p = p-> next;
}
}
int main(void)
{
int n;
struct node *h;
scanf("%d", &n);
h = creat(n);
print(h);
return 0;
}