#include<stdio.h>
#include<stdlib.h>
struct Node
{
    int data;
    struct Node *next;
};
struct Node* createNode(int data)
{
    struct Node*newNode=(struct Node*)malloc(sizeof(struct Node));
    newNode->data=data;
    newNode->next=NULL;
    return newNode;
}
struct Node* removeGenerator(struct Node*head,int max_height)
{
    struct Node *temp=head,*prev=NULL;
    while(temp != NULL && temp->data > max_height)
    {
        head=temp->next;
        free(temp);
        temp=head;
    }
    while(temp!=NULL)
    {
        while(temp!=NULL && temp->data <= max_height)
        {
            prev=temp;
            temp=temp->next;
        }
        if(temp==NULL)break;
        prev->next=temp->next;
        free(temp);
        temp=prev->next;
    }
    return head;
}
void printlist(struct Node* head)
{
    if(head==NULL)
    {
        printf("Empty");
        return;
    }
    struct Node* temp=head;
    while(temp!=NULL)
    {
        printf("%d",temp->data);
        if(temp->next != NULL)printf(" ");
        temp=temp->next;
    }
}
int main()
{
    int n,max_height,val;
    scanf("%d",&n);
    if(n<=0)
    {
        printf("Empty");
        return 0;
    }
    struct Node *head=NULL,*tail=NULL;
    for(int i=0;i<n;i++)
    {
        scanf("%d",&val);
        struct Node* newNode=createNode(Val);
        if(head==NULL)
            head=tail=newNode;
        else
        {
            tail->next=newNode;
            tail=newNode;
        }
    }
    scanf("%d",&max_height);
    head=removeGreater(head,max_height);
    printlist(head);
    return 0;
}