#include <bits/stdc++.h>
#define pb push_back
#define IOS                                                                    \
  ios_base::sync_with_stdio(false);                                            \
  cin.tie(0);                                                                  \
  cout.tie(0)
#define ll long long int
#define ld long double
#define el '\n'
#define PI (ld)3.14159265358979323846
#define inf (ll)1000000000
#define mod (ll)1000000007
#define mod1 (ll)998244353
#define fo(i, n) for (long long i = 0; i < int(n); i++)
#define pll pair<ll, ll>
#define ff first
#define ss second
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define sz(a) a.size()
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fd(i,a,b) for(ll i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define vl vector<ll>
//#define x ff
//#define y ss
#define pt(a) for(auto it:a)cout<<it<<" ";cout<<endl;
unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
using namespace std;

double gcd(double a, double b) { return a < 0.01 ? b : gcd(fmod(b, a), a); }

/*vector<int> parent, rak;

int find_set(int v) {
    if (v == parent[v])
        return v;
    return parent[v] = find_set(parent[v]);
}

void union_sets(int a, int b) {
    a = find_set(a);
    b = find_set(b);
    if (a != b) {
        if (rak[a] < rak[b])
            swap(a, b);
        parent[b] = a;
        rank[a]+=rank[b];
    }
}*/

long long bpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1)
      res = res * a % m;
      a = a * a % m;
      b >>= 1;
  }
  return res;
}
ll extend_gcd(ll a,ll b,ll &x,ll &y){
    if(b==0){
        x=1;
        y=0;
        return a;
    }
    ll x1,y1;
    ll ans =extend_gcd(b,a%b,x1,y1);
    x=y1;
    y=x1-(a/b)*y1;

    return ans;
}
ll inverse(ll a,ll m){
    ll x,y;
    extend_gcd(m,a,x,y);
    y%=m;
    y+=m;
    y%=m;
    return y;
}

/*const int N = 1000001;
int lp[N+1];
vector<int> pr;
void s(){
for (int i=2; i<=N; ++i) {
        if (lp[i] == 0) {
            lp[i] = i;
            pr.push_back (i);
        }
        for (int j=0; j<(int)pr.size() && pr[j]<=lp[i] && i*pr[j]<=N; ++j)
            lp[i * pr[j]] = pr[j];
    }
}*/


ll kv;
ll t,n,x,y,h,k,z,p,q,w;

//vector<vector<ll>>v;
//vector<ll>vis,d;

struct sg{
    ll s,p,q,r;
}; 

bool cmp(sg s1,sg s2){return s1.s<s2.s;}

ll d[2000][2000],e[2000][2000],f[2000][2000];
int main() {
    IOS;
    cin>>x>>y>>z>>k;
    ll a[x],b[y],c[z];
    fo(i,x)cin>>a[i];
    fo(i,y)cin>>b[i];
    fo(i,z)cin>>c[i];
    sort(a,a+x);sort(b,b+y);sort(c,c+z);
    sg s1={a[x-1]+b[y-1]+c[z-1],x-1,y-1,z-1};
    //d[x-1][y-1]=1;
    //e[y-1][z-1]=1;
    //f[z-1][x-1]=1;
    priority_queue<sg,vector<sg>,decltype(&cmp)>pq(cmp);
    //unordered_set<pair<ll,pll>>m;
    pq.push(s1);
    //cout<<pq.top().s<<el;
    //m.insert({x-1,{y-1,z-1}});
    while(h<k){
        h++;
        sg s1=pq.top();
        pq.pop();
        if(d[s1.p][s1.q]==0){
            d[s1.p][s1.q]=1;
            fo(i,z){
                if(e[s1.q][i]==0&&f[i][s1.p]==0){
                    if(s1.p==x-1&&s1.q==y-1&&i==z-1)continue;
                    sg s2;
                    s2.p=s1.p;
                    s2.q=s1.q;
                    s2.r=i;
                    s2.s=a[s1.p]+b[s1.q]+c[i];
                    pq.push(s2);
                    //m.insert({s2.p,{s2.q,s2.r}});
                }
            }
        }
        if(e[s1.q][s1.r]==0){
            e[s1.q][s1.r]=1;
            fo(i,x){
                if(d[i][s1.q]==0&&f[s1.r][i]==0){
                    if(i==x-1&&s1.q==y-1&&s1.r==z-1)continue;
                    sg s2;
                    s2.p=i;
                    s2.q=s1.q;
                    s2.r=s1.r;
                    s2.s=a[i]+b[s1.q]+c[s1.r];
                    pq.push(s2);
                    //m.insert({s2.p,{s2.q,s2.r}});
                }
            }
        }
        if(f[s1.r][s1.p]==0){
            f[s1.r][s1.p]=1;
            fo(i,y){
                if(d[s1.p][i]==0&&e[i][s1.r]==0){
                    if(s1.p==x-1&&i==y-1&&s1.r==z-1)continue;
                    sg s2;
                    s2.p=s1.p;
                    s2.q=i;
                    s2.r=s1.r;
                    s2.s=a[s1.p]+b[i]+c[s1.r];
                    pq.push(s2);
                    //m.insert({s2.p,{s2.q,s2.r}});
                }
            }
        }
        //m[{p,{q,r}}]++;
        cout<<s1.s<<el;
    }
    return 0;
}


Measured memory_bytes: 287960