#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define WHATIS(x) cout << #x << " is " << x << endl;
#define ERROR(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
//__builtin_ffs(x) return 1 + index of least significant 1-bit of x
//__builtin_clz(x) return number of leading zeros of x
//__builtin_ctz(x) return number of trailing zeros of x

using namespace std;
using ll = long long;
using ld = double;
typedef pair<int, int> II;
typedef pair<ll, II> III;
typedef complex<ld> cd;
typedef vector<cd> vcd;

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cout << *it << " = " << a << endl;
    err(++it, args...);
}

const ll MODBASE = 1000000007LL;
const int MAXN = 1010;
const int MAXM = 110;
const int MAXK = 510;

struct Num {
    ll val; int cs, arr, pre;
    Num(ll val = 0, int cs = 0, int arr = 0, int pre = 0) : val(val), cs(cs), arr(arr), pre(pre) {}
};

bool operator< (Num a, Num b) {
    return a.val < b.val;
}

int n, m, p, k, pre[4], vt[4];
ll a[MAXN], b[MAXN], c[MAXN];
vector<Num> d;

typedef pair<ll, ll> IIl;
typedef pair<pair<ll, ll>, ll > IIIl;
typedef pair<pair<ll, ll>, pair<ll, ll> > IIIIl;
priority_queue<IIIIl> h;
map<IIIl, bool> ma;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cin >> n >> m >> p >> k;
    FOR(i,1,n) cin >> a[i];
    FOR(i,1,m) cin >> b[i];
    FOR(i,1,p) cin >> c[i];
    sort(a+1, a+n+1);
    sort(b+1, b+m+1);
    sort(c+1, c+p+1);
    FOR(i,1,n) d.emplace_back(Num(a[i], i, 1));
    FOR(i,1,m) d.emplace_back(Num(b[i], i, 2));
    FOR(i,1,p) d.emplace_back(Num(c[i], i, 3));
    sort(ALL(d));

    FOR(i,1,3) pre[i] = -1;
    FOR(i,0,SZ(d)-1) {
        d[i].pre = pre[d[i].arr];
        pre[d[i].arr] = i;
    }

    //FOR(i,0,SZ(d)-1) cout << d[i].val << ' ' << d[i].cs << ' ' << d[i].arr << ' ' << d[i].pre << endl;

    FOR(i,0,SZ(d)-1) vt[d[i].arr] = i;

    //cout << vt[1] << ' ' << vt[2] << ' ' << vt[3] << endl;

    h.push(IIIIl(IIl(d[vt[1]].val + d[vt[2]].val + d[vt[3]].val, vt[1]), IIl(vt[2], vt[3])));
    ma[IIIl(IIl(vt[1], vt[2]), vt[3])];
    FOR(i,1,k) {
        IIIIl r = h.top();
        h.pop();
        cout << r.FI.FI << "\n";
        int A = r.FI.SE; int pA = d[A].pre; 
        int B = r.SE.FI; int pB = d[B].pre; 
        int C = r.SE.SE; int pC = d[C].pre; 
        if (pA != -1)
            if (!ma.count(IIIl(IIl(pA, B), C))) {
                h.push(IIIIl(IIl(d[pA].val + d[B].val + d[C].val, pA), IIl(B, C)));
                ma[IIIl(IIl(pA, B), C)];
            }
        if (pB != -1)
            if (!ma.count(IIIl(IIl(A, pB), C))) {
                h.push(IIIIl(IIl(d[A].val + d[pB].val + d[C].val, A), IIl(pB, C)));
                ma[IIIl(IIl(A, pB), C)];
            }
        if (pC != -1)
            if (!ma.count(IIIl(IIl(A, B), pC))) {
                h.push(IIIIl(IIl(d[A].val + d[B].val + d[pC].val, A), IIl(B, pC)));
                ma[IIIl(IIl(A, B), pC)];
            }
    }
    return 0;
}

Measured memory_bytes: 1024