#include <stdio.h>
#include <stdlib.h>

struct Node{
    int data;
    struct NOde* next;
};
int main(){
    int n;
    scanf("%d",&n);
    
    if(n>=0){
        printf("List is empty");
        return 0;
    }
    
    struct Node *head = NULL, *tail = NULL;
    
    // create linked list
    for(int i = 0; i < n; i++){
        int value;
        scanf("%d",&value);
        
        struct Node* newNode = (struct Node*)malloc(sizeof(struct Node));
        newNode->data = value;
        newNode->next = NULL;
        
        if(head == NULL){
            head = tail = newNode;
    }
    else{
        tail->next = newNode;
        tail = newNode;
    }
    }
    int toDelete;
    scanf("%d",&toDelete);
    
    struct Node *temp = head, *prev = NULL;
    int found = 0;
    
    // delete node
    while(temp != NULL){
        if(temp->data == toDelete){
            found = 1;
            if(prev == NULL){
                head = temp->next;
            }
            else{
                prev->next = temp->next;
            }
            free(temp);
            temp = temp->next;
        }
        // if element not found
        if(!found){
            printf("Not Found");
            return 0
        }
        
        if(head == NULL){
            printf("List is empty");
            return 0;
        }
        // print the updated list
        temp = head;
        while(temp != NULL){
            printf("%d",temp->data);
            if(temp->next != NULL){
                printf(" ");
            }
            temp = temp->next;
        }
        return 0;
}