#define _USE_MATH_DEFINES
#include <cmath>
#include <string>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <limits>
#include <vector>
#include <algorithm>
#include <functional>
#include <cctype>
#include <sstream>
#include <numeric>

typedef long long lint;
typedef long double ldouble;
using namespace std;
#define rep(i, n) for(lint i = 0; i < (lint)(n); i++)
#define repi(i,a,b) for(lint i=lint(a);i<lint(b);++i)
#define all(x) (x).begin(),(x).end()
#define sl(c) (('a')<=(c)&&(c)<=('z'))
#define ll(c) (('A')<=(c)&&(c)<=('Z'))
#define PI 3.141592653589793
#define cout (cout<<fixed<<setprecision(15))
#define makeupper(t) (transform(all(t),t.begin(),::toupper))
#define makelower(t) (transform(all(t),t.begin(),::tolower))
#define dist(x1,y1,x2,y2) (pow(pow(x2-x1,2)+pow(y2-y1,2),0.5))
#define sum(a) accumulate(all(a),0)
#define NEXT_LINE string junk; getline(cin, junk);
inline lint* arr1(lint x) {
	lint *array = new lint[x];
	rep(i, x)array[i] = 0;
	return array;
}
inline lint** arr2(lint x, lint y) {
	lint **array = new lint*[x];
	rep(i, x)array[i] = new lint[y];
	rep(i, x)rep(j, y)array[i][j] = 0;
	return array;
}
inline vector<string> split(const string &s, char delim) {
	vector<string> elems;
	stringstream ss(s);
	string item;
	while (getline(ss, item, delim)) {
		if (!item.empty()) {
			elems.push_back(item);
		}
	}
	return elems;
}
inline ldouble max(vector<ldouble> a) {
	ldouble M = a[0];
	rep(i, a.size())if (M < a[i])M = a[i];
	return M;
}
inline ldouble min(vector<ldouble> a) {
	ldouble m = a[0];
	rep(i, a.size())if (m > a[i])m = a[i];
	return m;
}
inline lint max(vector<lint> a) {
	lint M = a[0];
	rep(i, a.size())if (M < a[i])M = a[i];
	return M;
}
inline lint min(vector<lint> a) {
	lint m = a[0];
	rep(i, a.size())if (m > a[i])m = a[i];
	return m;
}
inline ldouble sum2(vector<ldouble> a, int n) {
	vector<ldouble> b;
	b.resize(a.size());
	rep(i, a.size())b[i] = powl(a[i], n);
	return sum(b);
}
inline lint sum2(vector<lint> a, int n) {
	lint sum=0;
	rep(i, a.size())sum += powl(a[i], n);
	return sum;
}
inline ldouble dist2(vector<ldouble> a, vector<ldouble> b,int num) {
	if (a.size() != b.size())return -1;
	vector<ldouble> c;
	c.resize(a.size());
	rep(i, a.size())c[i] = abs(b[i] - a[i]);
	if (num == 0)return max(c);
	else return pow(sum2(c, num), 1. / num);
}
inline ldouble dist2(vector<lint> a, vector<lint> b, int num) {
	if (a.size() != b.size())return -1;
	vector<lint> c;
	c.resize(a.size());
	rep(i, a.size())c[i] = abs(b[i] - a[i]);
	if (num == 0)return max(c);
	else return pow(sum2(c, num),1./num);
}
inline vector<int> cross(vector<int> a, vector<int> b) {
	return { a[1] * b[2] - a[2] * b[1],a[2] * b[0] - a[0] * b[2],a[0] * b[1] - a[1] * b[0] };
}
inline int GCD(int a, int b) {
	if (a < b)swap(a, b);
	if (a%b != 0)GCD(b, a%b);
	else return b;
}
inline vector<lint> primeList(lint n) {
	vector<bool> p(n+1);
	vector<lint> list;
	repi(i,1, n+1)p[i] = true;
	repi(i,2,sqrt(n)+1) {
		if (p[i]) {
			repi(j,2,n/i+1) {
				p[i*j] = false;
			}
		}
	}
	repi(i, 2, n+1)if (p[i])list.push_back(i);
	return list;
}
inline bool isPrime(int num){
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false;
	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2){
		if (num % i == 0)return false;
	}
	return true;
}
inline lint search(vector<lint> v,lint n) {
	lint left=0,right = v.size()-1;
	while (right >= left) {
		lint mid = (left + right) / 2;
		if (v[mid] == n)return mid;
		else if (v[mid] > n)right = mid - 1;
		else if (v[mid] < n)left = mid + 1;
	}
	return -1;
}

lint x, y, z, k;
vector<lint> a, b, c;
vector<vector<lint>>v;
void touroku(lint index, lint time) {
	int x = v[index][0];
	int y = v[index][1];
	int z = v[index][2];
	v.erase(v.begin()+index);
	cout << a[x] + b[y] + c[z]<<"\n";
	bool bx=false;
	rep(i, v.size())if (v[i] == vector<lint>{x - 1, y, z})bx = true;
	bool by = false;
	rep(i, v.size())if (v[i] == vector<lint>{x, y-1, z})by = true;
	bool bz = false;
	rep(i, v.size())if (v[i] == vector<lint>{x, y, z-1})bz = true;
	if (x != 0&&!bx)v.push_back({x-1,y,z});
	if (y != 0 &&!by)v.push_back({ x ,y-1,z });
	if (z != 0 &&!bz)v.push_back({ x,y,z-1 });
	lint max, max_index;
	if (v.size() != 0) {
		max = a[v[0][0]] + b[v[0][1]] + c[v[0][2]];
		max_index = 0;
		rep(i, v.size()) {
			if (max < a[v[i][0]] + b[v[i][1]] + c[v[i][2]]) {
				max = a[v[i][0]] + b[v[i][1]] + c[v[i][2]];
				max_index = i;
			}
		}
	}
	if(time<k)touroku(max_index, ++time);
}
int main() {
	cin >> x >> y >> z >> k;
	a.resize(x);
	b.resize(y);
	c.resize(z);
	rep(i, x)cin >> a[i];
	rep(i, y)cin >> b[i];
	rep(i, z)cin >> c[i];
	sort(all(a));
	sort(all(b));
	sort(all(c));
	v.push_back({x - 1,y-1,z-1});
	touroku(0,1);
}

Measured memory_bytes: 1152