#include<stdio.h>
#include<stdlib.h>
void display();
int create(int num);
int del(int num);
void display();

typedef struct {
    int data;
    struct node*next;
}node;

node *newNode =NULL;
node *head = NULL;
node *tail ;
node *first;
node *second;
int main()
{
    int size,i,num,val;
    scanf("%d",&size);
  
    if(size ==0){
        printf("Not Found");
        return 0;
    }
    for(i=i;i<size;i++){
        scanf("%d",&num);
        create (num);
    }
    scanf("%d",&val);
      del(val);
    if(head == NULL){
        printf("list is empty");
    }
    if(second == NULL){
        printf("Not Found");
    }
    else{
        display();
        return 0;
    }
int create(int num){
        newNode=(node*)malloc(sizeof(node));
        newNode->next=NULL;
        newNode->data=num;

if(head==NULL){
    head=newNode;
    tail=newNode;
}
else{
    tail->next=newNode;
    tail=newNode;
}
}
int del(int val){
    first =head;
    second=head->next;
    if(val==head->data)
      head=head->next;
      else{
          while(second!=NULL){
              if(second->data==val){
                  first->next= second->next;
                  break;
              }
              first=first->next;
              second=second->next;
          }
      }
}
void display(){
    node *tem;
    for(temp=head;temp!=NULL;temp=temp->next){
        printf("%d",temp->data);
    }
}