#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
struct Node{
    int data;
    struct Node*next;
};
struct Node*createnode(int val){
    struct Node*newnode=(struct Node*)malloc(sizeof(struct Node));
    newnode->data=val;
    newnode->next=NULL;
    return newnode;
}
void INM(struct Node**head,int val,int n){
    struct Node*newnode=createnode(val);
    if(*head==NULL){
        *head=newnode;
        return;
    }
    int mid=n/2;  
    struct Node*temp=head;

    for(int i=0;i<mid;i++){
        if(i==mid-1){ 
        break;
        }
        temp=temp->next;
    }
    newNode->next=temp->next;
    temp->next=newNode;
}
void printList(struct Node*head){
    while(head!=NULL){
        printf("%d ",head->data);
        head=head->next;
    }
}
int main(){
    int n,val;
    if(scanf("%d",&n)!=1||n<0||n>1000){
        printf("Invalid input");
        return 0;
    }
    struct Node*head=NULL;
    struct Node*tail=NULL;

    for(int i=0;i<n;i++){
        int x;
        if(scanf("%d",&x)!=1){
            printf("Invalid input");
            return 0;
        }
        struct Node*newnode=createnode(x);
        if (head==NULL){
            head=newnode;
            tail=newnode;
        } else {
            tail->next=newnode;
            tail=newnode;
        }
    }

    if (scanf("%d",&val)!=1){
        printf("Invalid input");
        return 0;
    }

    INM(&head,val,n);
    printList(head);
    return 0;
}