#include <iostream>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <stdlib.h>

typedef struct node{
	int key;
	int size;
	struct node *left;
	struct node *right;
}tree;

tree * insert(tree *root, int value){
	if(root == NULL){
		root = (tree *)malloc(sizeof(tree));
		root->key = value;
		root->left = root->right = 0;
		root->size = 1;
		return root;
	}
	root->size++;
	if(value > root->key)
		root->right = insert(root->right, value);
	else
		root->left = insert(root->left, value);
	return root;
}

tree * os_select(tree *root, int i){
	int r;
	if (root->left)
	    r = root->left->size + 1;
	else
		r = 1;
	if(i == r) return root;
	else{
		if(i < r) return os_select(root->left, i);
		else	  return os_select(root->right, i - r);
	}
}

void init_container(tree *container, const std::size_t n){
	std::size_t weight;
	for(std::size_t i = 0; i < n; i++){
		std::cin >> weight;
		container = insert(container, weight);
	}
}

void init_warehouse(std::priority_queue<std::size_t> *wh, const std::size_t m){
	std::size_t weight;
	for(std::size_t i = 0; i < m; i++){
		std::cin >> weight;
		wh->push(weight);
	}
}

void update_container(tree *container, std::priority_queue<std::size_t> warehouse){
	if(!warehouse.empty()){
		int piece_weight = warehouse.top();
		warehouse.pop();

		container = insert(container, piece_weight);
	}
}

int main(){
	std::size_t n, m, a, b, k;
	register int x = 0;
	std::priority_queue<std::size_t> warehouse;
	tree  *container = NULL;
	tree *piece = NULL;

	std::cin >> n;	//N кусков в контейнере
	std::cin >> m;	//M кусков в хранилище
	std::cin >> a;
	std::cin >> b;
	std::cin >> k;	//K кусков, выданных покупателю


	//Загружаем куски в соответствующие хранилища
	init_container(*&container, n);
	init_warehouse(&warehouse, m);

	while(k--){
		// Ищем кусок с номером x в порядке возрастания
		piece = os_select(container, x);
		std::cout << piece->key << " ";
		update_container(*&container, warehouse);
	}
}