// Day 7 assessment

//Reordering nodes
#include<stdio.h>
typedef struct Node{
    int data;
    struct Node *next;
}node;
node *head=NULL,*tail=NULL;
void createNode(int num){
    node *newnode=(node*)malloc(1*sizeof(node));
    newnode->data=num;
    newnode->next=NULL;
    if(head==NULL){
        head=tail=newnode;
    }
    else{
        tail->next=newnode; //point
        tail=newnode; //move
    }

}
void display(){
    node *temp;
    int pos;
    temp=head;
    pos=1;
    while(temp!=NULL){
        if(pos%2!=0){
            printf("%d ",temp->data);
        }
        temp=temp->next;
        pos++;
    }
    temp=head;
    pos=1;
    while(temp!=NULL){
        if(pos%2==0){
            printf("%d ",temp->data);
        }
        temp=temp->next;
        pos++;
    }    
}
int main(){
    int n;
    scanf("%d",&n);
    if(n<=0){
        printf("Invalid input");
        return 0;
    }
    for(int i=0;i<n;i++){
        int num;
        if(!scanf("%d",&num)){
            printf("Invalid input");
            return 0;
        }
        createNode(num);
    }
    display();

}