// editor4
#include<stdio.h>
#include<stdlib.h>

deftype struct node{
    int data;
    struct node *next;
} Node;
Node*head=NULL,*tail=NULL;

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;
    }
}

Node *first,*second;
void deteval val(int val){
    first  = head;
    second = first->next;
    if(val == head->data){
        head = head->next;
        return 0;
    }
    else{
        while(second != NULL){
            if(second-> data == val){
                first->next = second->next;
                return 0;
            }
        }
        first = second;
        second = second->next;
    }
}

void display(){
    Node *itr;
    for(itr=head;itr !=Null; itr=itr->next){
        printf("%d",itr->data);
    }
}

int main(){
    int n,x,del,found=0;
    Node*temp;
    scanf("%d",&n);
    if(i == 0){
        printf("List is empty");
        return 0;
    }
    for(int i=0;i<n;i++){
        scanf("%d",&x);
        create(x);
    }
    scanf("%d",del);
    temp = head;
    while(temp != NULL){
        if(temp-data == del){
            found=1;
            break;
        }
        temp=temp->next;
    }
    if(!found){
        printf("Not found");
        return 0;
    }
    deteval(del);
    display();
    return 0;
    
    
    
}