#include<stdio.h>
#include<stdlib.h>
struct Node{
    int data;
    struct Node *next;
};
int main(){
    int n;
    scanf("%d",&n);
    if(n<0){
        printf("Invalid input");
        return 0;
    }
    struct Node *head=NULL,*temp=NULL,*NEXTnode=NULL;
    for(int i=0;i<n;i++){
        newNode=(struct Node*)malloc(sizeof(struct Node));
        scanf("%d",&newNode->data);
        newNode->next=NULL;
        if(head==NULL){
            head=temp=newNode;
        }
        else{
            temp->next=newNode;
            temp=newNode;
        }
        struct Node *prev=NULL,*current=head,*next=NULL;
        while(current!=NULL){
            next=current->next;
            current->next=prev;
            prev-current;
            current=next;
        }
        head=prev;
        temp=head;
        while(temp!=NULL){
            printf("%d ",temp->data);
            temp=temp->next;
        }
        return 0;
    }