// editor1
#include<stdio.h>
#include<stdlib.h>
typedef struct Node{
    int data;
    struct Node *next;
    struct Node *prev;
}nd;
nd *head=NULL,*tail;
void create(int num){
    nd *newnode=(nd*)malloc(1*sizeof(nd));
    newnode->data=num;
    newnode->next-=NULL;
}if(head==NULL){
    head=newnode;
    tail=newnode;
}else{
    newnode->prev=head;
    tail->next=newnode;
    tail=newnode;
}
}
void remove(int x){
    nd *first;
    nd *second;
    first=head;
    second=head->next;
    if(x==head->data){
        head=head->next;
    }
    else{
        while(second!==NULL){
            if(second->data==x){
                first->next=second->next;
                break;
            }
            first=second;
            second=second->next;
        }
    }
    
}
void display(){
    nd *itr;
    for(itr=head;itr!=NULL;itr=itr->next){
        printf("%d",itr->data);
    }
}
int main(){
    int n,num,x;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
      scanf("%d",&num);
      create(num);
    }
    remove(x);
    display();
    return 0;
}