// editor2
#include <stdio.h>
#include <stdlib.h>
struct Node{
    int data;
    struct Node*next;
};
int main(){
    int N,p,i,value;
    scanf("%d",&N);
    if(N<=0){
        printf("Invalid input");
        return 0;
    }
    struct Node*head=NUll,*temp=Null,*newNode=NULL;
    for(i=0;i<N;i++){
        scanf("%d",&value);
        newNdode=(struct Node*)malloc(sizeof(struct Node));
        newNode->next=NULL;
        if(head==NULL){
            head=newNode;
            temp=head;
        }else{
            temp->next=newNode;
            temp=newNode;
        }
    }
    scanf("%d ",&P);
    if(P<0 || P>=N){
        printf("Invalid Input");
        return 0;
    }
    if(p==0){
        temp=head;
        head=head->next;
        free(temp);
        
    }else{
        struct Node*prev=head;
        for(i=0;i<p=1;i++){
            prev=prev->next;
        }
        temp=prev->next;
        prev->next=time->next;
        free(temp);
    }
    temp=head;
    while(temp!=NULL){
        printf("%d ",temp->da)
    }
}

    
    
}