#include<stdio.h>
#include<stdlib.h>
void del(int pos);
void display();
typedef struct Node{
    int data;
    struct Node *next;
}node;

node *head=NULL;
node *tail=NULL;
node *newnode=NULL;

void create(int v){
    newnode=(node*)malloc(1 * sizeof(node));
    newnode->data=v;
    newnode->next =NULL;
    if(head==0){
        head=newnode;
        tail=newnode;
    }
    else{
        tail->next=newnode;
        tail=newnode;
    }
}

void del(int pos){
    node *first=head;
    node *second=head->next;
    int cnt=1;
    while(1){
        if(cnt==pos){
            first->next=second->next;
            break;
        }
        first=first->next;
        second=second->next;
        cnt++;
    
    }
    
}
void display(){
    node *itr;
    for(itr=head;itr!=NULL;itr->next){
        printf("%d",itr->data);
        
    }
}
int main(){
    int size;
    int pos;
    int ind;
    int cnt=1;
    int v;
    scanf("%d",&size);
    if(size<=0){
        printf("Invalid input");
        return 0;
    }
    for(ind=0;ind<size;ind++){
        scanf("%d",&v);
        create(v);
    }
    scanf("%d",&pos);
    if(pos<1 || pos>=size){
        printf("Invalid input");
        return 0;
    }
    del(pos);
    display();
    return 0;
}