#include<stdio.h>
#include<stdlib.h>
struct Node{
    int data;
    struct Node *next;
};
int main(){
    int n,max_height,val;
    scanf("%d",&n);
    struct Node *head=NULL,*tail=NULL,*temp;
    for(int i=0;i<n;i++);{
        scanf("%d",&val);
        temp=(struct Node*) malloc (sizeof(struct Node));
        temp->data=val;
        temp->next=NULL;
        if(head==NULL) head=tail=temp;
        else{tail->next=temp;tail=temp;}
    }
    scanf("%d",&max_height);
    while(head && head->data>max_height){
        temp=head;
        head=head->next;
        free(temp);
    }
    if(!head){
        printf("Empty\n");
        return 0;
    }
    struct Node *curr=head;
    while(curr->next) {
        if(curr->next->data >max_height){
            temp=curr->next->next;
            free(temp);
        }else curr=curr->next;
    }
    for(temp=head;temp;temp=temp->next)
    printf("%d%s",temp->data,temp->next?" ":"\n");
    return 0;
}

      
}