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