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)



ans = []

for i in range(X):

    for j in range(Y):

        for k in range(Z):

            if (i+1)*(j+1)*(k+1) <= K: ans.append(A[i]+B[j]+C[k])

            else: break

ans.sort(reverse=True)

for i in range(K): print((ans[i]))
from heapq import heappop,heappush

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)



q = []

heappush(q,(-(A[0]+B[0]+C[0]),0,0,0))

for i in range(K):

    ans, i,j,k = heappop(q)

    print((-ans))

    if i+1 < X:

        t = (-(A[i+1]+B[j]+C[k]),i+1,j,k)

        if t not in q:

            heappush(q,t)

    if j+1 < Y:

        t = (-(A[i]+B[j+1]+C[k]),i,j+1,k)

        if t not in q:

            heappush(q,t)

    if k+1 < Z:

        t = (-(A[i]+B[j]+C[k+1]),i,j,k+1)

        if t not in q:

            heappush(q,t)
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)
ans = []
for i in range(X):
    for j in range(Y):
        for k in range(Z):
            if (i + 1) * (j + 1) * (k + 1) <= K:
                ans.append(A[i] + B[j] + C[k])
            else:
                break
ans.sort(reverse=True)
for i in range(K):
    print((ans[i]))

from heapq import heappop, heappush

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)
q = []
heappush(q, (-(A[0] + B[0] + C[0]), 0, 0, 0))
for i in range(K):
    ans, i, j, k = heappop(q)
    print((-ans))
    if i + 1 < X:
        t = (-(A[i + 1] + B[j] + C[k]), i + 1, j, k)
        if t not in q:
            heappush(q, t)
    if j + 1 < Y:
        t = (-(A[i] + B[j + 1] + C[k]), i, j + 1, k)
        if t not in q:
            heappush(q, t)
    if k + 1 < Z:
        t = (-(A[i] + B[j] + C[k + 1]), i, j, k + 1)
        if t not in q:
            heappush(q, t)

+from heapq import heappop, heappush + -ans = [] -for i in range(X): -    for j in range(Y): -        for k in range(Z): -            if (i + 1) * (j + 1) * (k + 1) <= K: -                ans.append(A[i] + B[j] + C[k]) -            else: -                break -ans.sort(reverse=True) +q = [] +heappush(q, (-(A[0] + B[0] + C[0]), 0, 0, 0)) -    print((ans[i])) +    ans, i, j, k = heappop(q) +    print((-ans)) +    if i + 1 < X: +        t = (-(A[i + 1] + B[j] + C[k]), i + 1, j, k) +        if t not in q: +            heappush(q, t) +    if j + 1 < Y: +        t = (-(A[i] + B[j + 1] + C[k]), i, j + 1, k) +        if t not in q: +            heappush(q, t) +    if k + 1 < Z: +        t = (-(A[i] + B[j] + C[k + 1]), i, j, k + 1) +        if t not in q: +            heappush(q, t)