// editor2
#include <stdio.h>
#include <stdlib.h>
struct node
{
    int data;
    struct node* next;
}*head,*tail;
int main()
{
    int n,i;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        struct node* newnode=(struct node*)malloc(sizeof(struct node));
       if( scanf("%f",&newnode->data)!=1)
       {
           printf("Invalid input");
           return 0;
       }
       
        if(head==NULL)
        {
            head=newnode;
            tail=newnode;
            head->next=NULL;
        }else
        {
            tail->next=newnode;
            tail=newnode;
            newnode->next=NULL;
        }
    }
    int x;
    scanf("%d",&x);
    for(i=0;i<n;i++)
    {
        if(head->data!=x)
        printf("%d",head->data);
    }
}