#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define len 10000
#define maxint 1<<31-1

int tree[len];
void tree_initial(){
    for(int i = 0;i<len;i++){
        tree[i] = maxint;
    }
}

int main(){
    int n;
    while(scanf("%d",&n)!=EOF){
        for(int i = 1;i<=n;i++){
            scanf("%d",&tree[i]);
        }
        int h;
        scanf("%d",&h);
        int flag = 0;
        for(int i = pow(2,h-1);i<=pow(2,h)-1&&i<=n;i++){
            if(flag){
                printf(" ");
            }
            flag = 1;
            printf("%d",tree[i]);
        }
        if(flag==0){
            printf("EMPTY\n");
        }
        printf("\n");
    }
}