#include <iostream>
using namespace std;
const int N = 1e+5;
// 尾指针, val, next, 产生结点位置
int tail, e[N], ne[N], idx;
void init(){
tail = 0;
idx = 1;
}
void insert(int a){
e[idx] = a;
ne[tail] = idx;
ne[idx] = -1;
tail = idx ++;
}
int main(void){
int n;
cin >> n;
init();
for(int i = 0; i < n; i ++){
int a;
cin >> a;
insert(a);
}
for(int i = 1; i != -1; i = ne[i])
printf("%d ", e[i]);
return 0;
}