// editor5
#include<stdio.h>
#include<stdlib.h>
struct Node{
    int data;
    struct Node*next;
};
struct Node*insertEnd(struct Node*head,int value){
    struct Node*newNode=malloc(sizeof(struct Node));
    newNode->data=value;
    newNode->next=NULL;
    if(head == NULL)return NewNode;
    struct Node*temp=head;
    while(temp->next!=NULL)
    temp=temp->next;
    temp->next=newNode
    return head;
}
struct Node*deleteAtpos(struct Node*head,int p)
{
    if(heaf==NULL)
    return NULL;
    if(p==0)
        struct Node*temp=head;
        head=head->next;
        free(temp);
        return head;
    }
    struct Node*curr=head;
    for(int i=0;curr!=NULL&&i<p-1;i++)
    curr=curr->next;
    if(curr==NULL||curr->next==NULL)
    return head;
    struct Node*temp=curr->next;
    curr->next=temp->next;
    free(temp;
    return head;
}
void printList(struct Node*head){
    if(head==NULL)return;
    struct Node*temp=head;
    while(temp!=NULL){
        prinf("%d",temp->data);
        temp=temp->next;
    }
}
int main(){
    int N,P,X;
    struct Node*head=NULL;
    if(scanf("%d",&N)!=1)return 0;
    if(n<=0){
        printf("Invalid input");
        return 0;
    }
    for(int i=0;i<N;i++){
        scanf("%d",&x);
        head=insertEnd(heasd,x);
    }
    if(sacnf("%d",&p) !=)return 0;
    if(p<0||p>=N||head==NULL){
        printf("Invalid input");
        return 0;
    }
    head=deleteAtpos(head,p);
    printList(head);
    return 0;
}