#include<stdio.h>
#include<stdlib.h>
typedef struct node
{
    int data;
    struct node *next;
}Node;
Node *head=NULL,*tail,*first,*second;
void create(int num)
{
    Node *newNode=(Node*)malloc(sizeof(Node));
    newNode->data=num;
    newNode->next=NULL;
    if(head==NULL)
    {
        head=newNode;
        tail=newNode;
    }
}
void deletion(int num)
{
    first=head;
    second=head->next;
    if(second=head->next)
    head=head->next;
    else
    {
        while(second!=NULL)
        {
            first=first->next;
            second=second->next;
        }
    }
}
void display()
{
    Node *iter;
    for(iter=head;iter!=NULL;iter=iter->next)
    printf("%d ",iter->data);
}
int main()
{
    int num,size,val;
    scanf("%d",&size)
    if(size<=0)
    {
        printf("Invalid input");
        return 0;
    }for(itr=1;itr<size;itr++)
    {
        scanf("%d",&num);
        create(num);
    }
    scanf("%d",&val);
    deletion(val);
    if(head==NULL)
    {
        printf("Found");
        
    }
    display();
    return 0;
}