#include <stdio.h>
#include <stdlib.h>
const int N = 2e5+10;
struct node{
int val;
node* ne;
};
int a[N], n;
int main(){
scanf("%d", &n);
for(int i=1; i<=n; i++) scanf("%d", a+i);
// 新建一个节点, 头节点, 也指此链表
node* head = (node*)malloc(sizeof(node));
head->val = 0; // head 的 val 存放节点数量
head->ne = NULL; // head 的 ne 指向下一个节点
// 新建一个指针, 当前操作位置
node* pos = head;
for(int i=1; i<=n; i++){
// 新建一个节点, 新的节点
node* newNode = (node*)malloc(sizeof(node));
newNode->val = a[i];
newNode->ne = NULL;
pos->ne = newNode; // 当前节点的下一个 = 新节点
pos = newNode; // 当前节点 = 新节点
head->val ++;
}
pos = head->ne;
while(pos != NULL){
printf("%d ", pos->val);
pos = pos->ne;
}
return 0;
}