#include<stdio.h>
#include<stdlib.h>
struct node{
    int data;
    struct node*next;
};
int main(){
    int n;
    scanf("%d",&n);
    if(n<0||n>100){
        printf("Invalid input");
        return 0;
    }
    struct node*head=NULL,*temp,*newnode;
    for(int i=0;i<n;i++){
        newnode=(struct node*)malloc(sizeof(struct node));
        scanf("%d",&newnode->data);
        newnode->next=NULL;
        if(head==NULL)
        head=newnode;
        else
        temp->next=newnode;
        temp=newnode;
    }
    int max_height;
    scanf("%d",&max_height); 
    struct node*current=head,*prev;
    while(current!=NULL){
        if(current->data>max_height){
            if(current==head){
                head=current->next;
                free(current);
                current=head;
            }
        }    
            else{
                prev=current;
                current=current->next;
            }
    }
    if(head==NULL){
        printf("Empty");
    }
    else{
        temp=head;
        while(temp!=NULL){
            printf("%d",temp->data);
            if(temp->next!=NULL)
            printf(" ");
            temp=temp->next;
        }
    }
    temp=head;
    while(temp!=NULL){
        struct node*nextnode=temp->next;
        free(temp);
        temp=nextnode;
    }
    return 0;
}