// editor3
#include <stdio.h>
#include <stdlib.h>
struct node
{
    int data;
    struct node* next;
}*head,*tail,*temp;
int main()
{
    int n,i;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        struct node* newnode=(struct node*)malloc(sizeof(struct node));
       if( scanf("%d",&newnode->data)!=1)
       {
           printf("Invalid input");
           return 0;
       }
       
        if(head==NULL)
        {
            head=newnode;
            tail=newnode;
            head->next=NULL;
        }else
        {
            tail->next=newnode;
            tail=newnode;
            newnode->next=NULL;
        }
    }
    temp=head;
    int x;
    scanf("%d",&x);
    if(x<1||x>n)
    {
        printf("Invalid input");
        return 0;
    }
    struct node* t;
    if(x==1)
    head=head->next;
    else if(x==2)
    head->next=head->next->next;
    else
    {
        for(i=1;i<x-1;i++)
            temp=temp->next;
        temp->next=temp->next->next;
    }
    for(i=1;i<n;i++)
    {
      printf("%d ",head->data);  
      head=head->next;
    }
}
}