#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;
    }
    tail->next=newnode;
    tail=newnode;
}
void del(int val){
    first=head;
    second=head->next;
    if(head->data==val){
        head=head->next;
    }
    else{
        while(second!=NULL){
            if(second->data==val){
                first->next=second->next;
            }
            first=first->next;
            second=second->next;
        }
    }
}
void display(){
    int *itr;
    for(itr=head;itr!=NULL;itr=itr->next){
        printf("%d",itr->data);
    }
}
int main(){
    int size,num,pos,itr;
    scanf("%d",&size);
    for(itr=1;itr<=size;itr++){
        scanf("%d",&num);
        create(num);
    }
    scanf("%d",&val);
    delete(val);
    if(second==NULL){
        printf("Node not found");
        return 0;
    }
    display();
    return 0;
    
}