#include <bits/stdc++.h>
using namespace std;
using namespace __gnu_cxx;
#define dprint(v) cout << #v"=" << v << endl //;)
#define sz(c) ((int)c.size())
#define zero(v) memset(v, 0, sizeof(v))
#define forall(it,v) for(auto it=v.begin();it!=v.end();++it)
#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#define INF (ll)1e16
#define endl '\n'
#define isin(x,y) ((y).find(x)!=(y).end())
#define forr(i,a,b) for(int i=(a); i<(b); i++)

typedef long long ll;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<vll> vvll;

typedef pair<int,int> ii;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll x,y,z,k;
        cin>>x>>y>>z>>k;
        vll a(x);
        forn(i,x)cin>>a[i];
        vll b(y);
        forn(i,y)cin>>b[i];
        vll c(z);
        forn(i,z)cin>>c[i];
        sort(rall(a));
        sort(rall(b));
        sort(rall(c));

        vector<pair<ll,vector<ll>>> ab;
        forn(i,x){
            for(int j=0;j<y;j++){
                vector<ll> tmp;
                tmp.pb(i);
                tmp.pb(j);
                ab.pb(mp(a[i]+b[j],tmp));
            }
        }
        sort(rall(ab));

        vector<pair<ll,vector<ll>>> ac;
        forn(i,x){
            for(int j=0;j<z;j++){
                vector<ll> tmp;
                tmp.pb(i);
                tmp.pb(j);
                ac.pb(mp(a[i]+c[j],tmp));
            }
        }
        sort(rall(ac));

        vector<pair<ll,vector<ll>>> bc;
        forn(i,y){
            for(int j=0;j<z;j++){
                vector<ll> tmp;
                tmp.pb(i);
                tmp.pb(j);
                bc.pb(mp(b[i]+c[j],tmp));
            }
        }
        sort(rall(bc));


        ll ans=0;
        ll o1=0,o2=0,o3=0;
        ll t1=0,t2=0,t3=0;
        set<vll> vis;
        ll top=k;
        k=min(x*y*z,500000LL);
        vll pp;
        while(k){
            vll now;
            now.pb(ab[o1].ff+c[t1%z]);
            now.pb(ac[o2].ff+b[t2%y]);
            now.pb(bc[o3].ff+a[t3%x]);
            vll v(3);
            switch(max_element(all(now))-now.begin()){
                case 0:
                    v[0]=ab[o1].ss[0];
                    v[1]=ab[o1].ss[1];
                    v[2]=t1%z;
                    if(isin(v,vis)){
                        ++t1;
                        if(t1&&!(t1%z))++o1;
                        continue;
                    }else{
                        ans=now[0];
                        ++t1;--k;
                        pp.pb(ans);
                    }
                    if(t1&&!(t1%z))++o1;
                    break;
                case 1:
                    v[0]=ac[o2].ss[0];
                    v[2]=ac[o2].ss[1];
                    v[1]=t2%y;
                    if(isin(v,vis)){
                        ++t2;
                        if(t2&&!(t2%y))++o2;
                        continue;
                    }else{
                        ans=now[1];
                        ++t2;--k;
                        pp.pb(ans);
                    }
                    if(t2&&!(t2%y))++o2;
                    break;
                case 2:
                    v[1]=bc[o3].ss[0];
                    v[2]=bc[o3].ss[1];
                    v[0]=t3%x;
                    if(isin(v,vis)){
                        ++t3;
                        if(t3&&!(t3%x))++o3;
                        continue;
                    }else{
                        ans=now[2];
                        ++t3;--k;
                        pp.pb(ans);
                    }
                    if(t3&&!(t3%x))++o3;
                    break;
            }
            vis.insert(v);

            //if(k==3)return 0;
        }
        sort(rall(pp));
        forn(i,top)cout<<pp[i]<<endl;
	return 0;
}


Measured memory_bytes: 242532