#include<stdio.h>
#include<stdlib.h>

typedef struct Node{
    int data;
    struct Node *next;
}node;

node *head = NULL; *tail;

void create(int num){
    node *newNode = (node*)malloc(sizeof(node));
    newNode->data = num;
    newNode->next = NULL;
    if(head == NULL){
        head = newNode;
    }
    else {
        tail->next = newNode;
    }
    tail = newNode;
}

void deletion(int del){
    node *first = head;
    node *second = head->next;
    while(1){
        if(second->data == del){
            first->next = second->next;
            break;
        }
        first = first->next;
        second =  second->next;
    }
}

void display(){
    node *i;
    for(i=head;i!=NULL;i++){
        printf("%d",i->data);
    }
}

int main(){
   int n,num,del;
   scanf("%d",&n);
   scanf("%d",&del);
   for(int i=0;i<n;i++){
       scanf("%d",&num);
       create(num);
   }
   deletion(del);
   if(second==NULL){
       printf("Node not found");
       return 0;
   }
   else {
       display();
   }
}