#include <cstdio>
#include <cstdlib>
#include <cstddef>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <iostream>
#include <iomanip>

#define ASDF (1000000007)
#define MODADD(A, B) (A = (A + B) % ASDF)

long modpow(long src, long pow, long mod)
{
    long res = 1;
    while (0 < pow) {
        if (pow % 2 == 1) {
            res = (res * src) % mod;
            pow--;
        }
        src = (src * src) % mod;
        pow /= 2;
    }
    return res;
}

long modinv(long src, long mod)
{
    return modpow(src, mod - 2, mod);
}

long getgcd(long a, long b) {
    while (0 < a && 0 < b) {
        if (a < b)
            b = b % a;
        else
            a = a % b;
    }
    return std::max(a, b);
}

std::vector<int> getFlags(long long value)
{
    std::vector<int> ret;
    if (value <= 0) {
        ret.resize(1, 0);
        return ret;
    }
    int digit = 0;
    long long tmpval = value;
    while (0 < tmpval) {
        digit++;
        tmpval /= 2;
    }
    ret.resize(digit, 0);
    for (int i = digit - 1; 0 <= i; i--) {

        long long a = 1;
        for (int j = 0; j < i; j++) {
            a *= 2;
        }
        a--;
        if (a < value) {
            long long rem = value - a;
            if (rem % 2 == 1) {
                ret[i] = 1;
            }
            if (i > 1)
                value = rem - 1;
            else
                value = rem;
        }
        //if (1 == i) {
        //    ret[0] = value % 2;
        //}
    }
    if (value % 2 != 0) ret[0] = 1;
    return ret;
}

struct candSet {
    int idx_a;
    int idx_b;
    int idx_c;
    candSet(int idxa, int idxb, int idxc) :idx_a(idxa), idx_b(idxb), idx_c(idxc){}
    bool operator==(const candSet& x) { return idx_a == x.idx_a && idx_b == x.idx_b && idx_c == x.idx_c; }
    bool operator!=(const candSet& x) { return idx_a != x.idx_a && idx_b != x.idx_b && idx_c != x.idx_c; }
};

std::vector<candSet> getNext(const candSet& c, const std::vector<long long>& xs, const std::vector<long long>& ys, const std::vector<long long>& zs)
{
    std::vector<candSet> a;
    if (c.idx_a < xs.size() - 1) {
        a.push_back(candSet(c.idx_a + 1, c.idx_b, c.idx_c));
    }
    if (c.idx_b < ys.size() - 1) {
        a.push_back(candSet(c.idx_a, c.idx_b + 1, c.idx_c));
    }
    if (c.idx_c < zs.size() - 1) {
        a.push_back(candSet(c.idx_a, c.idx_b, c.idx_c + 1));
    }
    return a;
}

void addif(std::vector<candSet>& kisonList, const std::vector<candSet>& addset)
{
    for (const candSet& addItem : addset) {
        if (std::find(kisonList.begin(), kisonList.end(), addItem) == kisonList.end()) {
            kisonList.push_back(addItem);
        }
    }
}

long long getVal(const candSet& cSet, const std::vector<long long>& xs, const std::vector<long long>& ys, const std::vector<long long>& zs)
{
    return xs[cSet.idx_a] + ys[cSet.idx_b] + zs[cSet.idx_c];
}

int main(void)
{
    long long x, y, z, k;
    std::cin >> x >> y >> z >> k;
    std::vector<long long> xs, ys, zs;
    for (long long i = 0; i < x; i++) {
        long long tmp;
        std::cin >> tmp;
        xs.push_back(tmp);
    }
    for (long long i = 0; i < y; i++) {
        long long tmp;
        std::cin >> tmp;
        ys.push_back(tmp);
    }
    for (long long i = 0; i < z; i++) {
        long long tmp;
        std::cin >> tmp;
        zs.push_back(tmp);
    }
    std::sort(xs.begin(), xs.end(), [](const long long& a, const long long& b) { return a > b; });
    std::sort(ys.begin(), ys.end(), [](const long long& a, const long long& b) { return a > b; });
    std::sort(zs.begin(), zs.end(), [](const long long& a, const long long& b) { return a > b; });

    std::cout << xs[0] + ys[0] + zs[0] << std::endl;

    
    candSet c1(1, 0, 0);
    candSet c2(0, 1, 0);
    candSet c3(0, 0, 1);
    std::vector<candSet> nextSet;
    addif(nextSet, getNext(candSet(0, 0, 0), xs, ys, zs));
    for (int i = 1; i < k; i++) {
        candSet maxSet = nextSet.front();
        long long maxval = getVal(maxSet, xs, ys, zs);
        size_t pos = 0;
        size_t tot = nextSet.size();
        for (size_t a = 1; a < tot; a++) {
            long long val = getVal(nextSet[a], xs, ys, zs);
            if (maxval < val) {
                maxval = val;
                maxSet = nextSet[a];
                pos = a;
            }
        }
        std::cout << maxval << std::endl;
        nextSet.erase(nextSet.begin() + pos);
        addif(nextSet, getNext(maxSet, xs, ys, zs));
    }
    return 0;
}


Measured memory_bytes: 384