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)



apb =  []



for a in A:

    for b in B:

        apb.append(a+b)

apb.sort(reverse=True)



apb = apb[:K]

ans = []



for k in apb:

    for c in (C):

        ans.append(k+c)

ans.sort(reverse=True)



for k in range(K):

    print((ans[k]))



    

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)





count = 0

queued = set()

from heapq import heappush, heappop

hpq = []



i = j = k = 0

heappush(hpq, ( -(A[i]+B[j]+C[k]), i,j,k) )

queued.add( (i,j,k) )



ans = []

for k in range(K):

    p = heappop( hpq)

    ans.append( - p[0]  )

    if k == K-1: break

    i,j,k = p[1:]



    if (not (i+1,j,k) in queued) and i+1 < X and j < Y and k < Z:

        queued.add((i+1,j,k))

        heappush(hpq, (-(A[i+1]+B[j]+C[k]),i+1,j,k) )

        # i+=1

    if (not (i,j+1,k) in queued) and i < X and j+1 < Y and  k < Z:

        queued.add((i,j+1,k))

        heappush(hpq, (-(A[i]+B[j+1]+C[k]), i,j+1,k))

        # j+=1

    if (not (i,j,k+1) in queued) and i < X and j < Y and k+1 <Z:

        queued.add((i,j,k+1))

        heappush(hpq, (-(A[i]+B[j]+C[k+1]), i,j,k+1))

        # k+=1



for k in range(K):

    print((ans[k]))

            





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)
apb = []
for a in A:
    for b in B:
        apb.append(a + b)
apb.sort(reverse=True)
apb = apb[:K]
ans = []
for k in apb:
    for c in C:
        ans.append(k + c)
ans.sort(reverse=True)
for k in range(K):
    print((ans[k]))

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)
count = 0
queued = set()
from heapq import heappush, heappop

hpq = []
i = j = k = 0
heappush(hpq, (-(A[i] + B[j] + C[k]), i, j, k))
queued.add((i, j, k))
ans = []
for k in range(K):
    p = heappop(hpq)
    ans.append(-p[0])
    if k == K - 1:
        break
    i, j, k = p[1:]
    if (not (i + 1, j, k) in queued) and i + 1 < X and j < Y and k < Z:
        queued.add((i + 1, j, k))
        heappush(hpq, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k))
        # i+=1
    if (not (i, j + 1, k) in queued) and i < X and j + 1 < Y and k < Z:
        queued.add((i, j + 1, k))
        heappush(hpq, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k))
        # j+=1
    if (not (i, j, k + 1) in queued) and i < X and j < Y and k + 1 < Z:
        queued.add((i, j, k + 1))
        heappush(hpq, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1))
        # k+=1
for k in range(K):
    print((ans[k]))

-apb = [] -for a in A: -    for b in B: -        apb.append(a + b) -apb.sort(reverse=True) -apb = apb[:K] +count = 0 +queued = set() +from heapq import heappush, heappop + +hpq = [] +i = j = k = 0 +heappush(hpq, (-(A[i] + B[j] + C[k]), i, j, k)) +queued.add((i, j, k)) -for k in apb: -    for c in C: -        ans.append(k + c) -ans.sort(reverse=True) +for k in range(K): +    p = heappop(hpq) +    ans.append(-p[0]) +    if k == K - 1: +        break +    i, j, k = p[1:] +    if (not (i + 1, j, k) in queued) and i + 1 < X and j < Y and k < Z: +        queued.add((i + 1, j, k)) +        heappush(hpq, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k)) +        # i+=1 +    if (not (i, j + 1, k) in queued) and i < X and j + 1 < Y and k < Z: +        queued.add((i, j + 1, k)) +        heappush(hpq, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k)) +        # j+=1 +    if (not (i, j, k + 1) in queued) and i < X and j < Y and k + 1 < Z: +        queued.add((i, j, k + 1)) +        heappush(hpq, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1)) +        # k+=1