#include<stdio.h>
#include<stdlib.h>

typedef struct node
{
    int data;
    struct node *left,*right;
}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;
    }
    else
    {
        tail->next=newnode;
        tail=newnode;
    }
}

void deletion(int value)
{
    first=head;
    second=head->next;
    if(value==head->data)
        head=head->next;
    else
    {
        while(second!=NULL)
        {
            first->next=second->next;
            break;
        }
        first=first->next;
        second=second->next;
    }
}

void display()
{
    Node *itr;
    for(itr=head;itr!=NULL;itr=itr->next)
    {
        printf("%d",itr->data);
    }
}

int main()
{
    int num,size,value;
    scanf("%d",&size);
    if(size<0)
    {
        printf("Invalid input");
        return 0;
    }
    for(int i=0;i<size;i++)
    {
        scanf("%d",&num);
        create(num);
    }
    scanf("%d",&value);
    deletion(value);
    
    if(head==NULL)
    {
        printf("found");
    }
    else if(second==NULL)
    {
        printf("Node not found");
    }
    display();
}