x,y,z,k = list(map(int,input().split()))



a=list(map(int,input().split()))

b=list(map(int,input().split()))

c=list(map(int,input().split()))



tem = []



for i in range(x):

    for j in range(y):

        tem.append(a[i]+b[j])



tem.sort()

if(x*y > k):

    tem2 = tem[x*y-k-1:]

else:

    tem2 = tem

ans = []

for i in range(len(tem2)):

    for j in range(z):

        ans.append(tem2[i]+c[j])



ans.sort()

dd = len(tem2)*z

for i in list(reversed(list(range(dd-k,dd)))):

    print((ans[i]))
x,y,z,k = list(map(int,input().split()))



a=list(map(int,input().split()))

b=list(map(int,input().split()))

c=list(map(int,input().split()))



a.sort(reverse=True)

b.sort(reverse=True)

c.sort(reverse=True)



def judge(p):

    cnt = 0

    for i in range(x):

        for j in range(y):

            for kk in range(z):

                if a[i]+b[j]+c[kk] < p : break

                cnt += 1

                if (cnt >= k):return True

    return False



ll,rr = 0,a[0]+b[0]+c[0]

while(rr- ll > 1):

    md = (ll+rr) // 2

    if(judge(md)) : ll = md

    else : rr = md



ans = []

cnt=0

for i in range(x):

    if(cnt >= k):break

    for j in range(y):

        if(cnt >= k):break

        for kk in range(z):

            if(cnt >= k):break

            if a[i]+b[j]+c[kk] < rr : break

            cnt += 1

            ans.append(a[i]+b[j]+c[kk])



if len(ans) <k:

    for i in range(k-len(ans)):

        ans.append(ll)



ans.sort(reverse=True)



for i in ans:

    print(i)
x, y, z, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
tem = []
for i in range(x):
    for j in range(y):
        tem.append(a[i] + b[j])
tem.sort()
if x * y > k:
    tem2 = tem[x * y - k - 1 :]
else:
    tem2 = tem
ans = []
for i in range(len(tem2)):
    for j in range(z):
        ans.append(tem2[i] + c[j])
ans.sort()
dd = len(tem2) * z
for i in list(reversed(list(range(dd - k, dd)))):
    print((ans[i]))

x, y, z, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)


def judge(p):
    cnt = 0
    for i in range(x):
        for j in range(y):
            for kk in range(z):
                if a[i] + b[j] + c[kk] < p:
                    break
                cnt += 1
                if cnt >= k:
                    return True
    return False


ll, rr = 0, a[0] + b[0] + c[0]
while rr - ll > 1:
    md = (ll + rr) // 2
    if judge(md):
        ll = md
    else:
        rr = md
ans = []
cnt = 0
for i in range(x):
    if cnt >= k:
        break
    for j in range(y):
        if cnt >= k:
            break
        for kk in range(z):
            if cnt >= k:
                break
            if a[i] + b[j] + c[kk] < rr:
                break
            cnt += 1
            ans.append(a[i] + b[j] + c[kk])
if len(ans) < k:
    for i in range(k - len(ans)):
        ans.append(ll)
ans.sort(reverse=True)
for i in ans:
    print(i)

-tem = [] +a.sort(reverse=True) +b.sort(reverse=True) +c.sort(reverse=True) + + +def judge(p): +    cnt = 0 +    for i in range(x): +        for j in range(y): +            for kk in range(z): +                if a[i] + b[j] + c[kk] < p: +                    break +                cnt += 1 +                if cnt >= k: +                    return True +    return False + + +ll, rr = 0, a[0] + b[0] + c[0] +while rr - ll > 1: +    md = (ll + rr) // 2 +    if judge(md): +        ll = md +    else: +        rr = md +ans = [] +cnt = 0 +    if cnt >= k: +        break -        tem.append(a[i] + b[j]) -tem.sort() -if x * y > k: -    tem2 = tem[x * y - k - 1 :] -else: -    tem2 = tem -ans = [] -for i in range(len(tem2)): -    for j in range(z): -        ans.append(tem2[i] + c[j]) -ans.sort() -dd = len(tem2) * z -for i in list(reversed(list(range(dd - k, dd)))): -    print((ans[i])) +        if cnt >= k: +            break +        for kk in range(z): +            if cnt >= k: +                break +            if a[i] + b[j] + c[kk] < rr: +                break +            cnt += 1 +            ans.append(a[i] + b[j] + c[kk]) +if len(ans) < k: +    for i in range(k - len(ans)): +        ans.append(ll) +ans.sort(reverse=True) +for i in ans: +    print(i)