#include
#include
#include
using namespace std;
class node{
public:
int data;
node *next;
node(int d){
data = d;
next = NULL;
}
};
void insertathead(node*&head,int d){
if(head==NULL){
head = new node(d);
return;
}
node*n = new node(d);
n->next = head;
head = n;
}
vector v;
void reverselist(node*&head){
while(head!=NULL){
v.push_back(head->data);
head = head->next;
}
reverse(v.begin(),v.end());
for(auto x:v){
cout<<x<<" ";
}
cout<<endl;
}
int main() {
int n;
cin>>n;
node*head=NULL;
for(int i=0;i<n;i++){
int d;
cin>>d;
insertathead(head,d);
}
reverselist(head);
return 0;
}