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()))



sumsofAandB = sorted([a+b for a in A for b in B], reverse=True)[:K]

sumsofAll = sorted([ab+c for ab in sumsofAandB for c in C], reverse=True)

for i in range(K):

    print((sumsofAll[i]))
from heapq import heappush, heappop



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)

h = []



maxv = A[0] + B[0] + C[0]





def inv(v):

    return maxv - v





pushed = [[[] for _ in range(Y)] for _ in range(X)]

heappush(h, (0, 0, 0, 0))

for _ in range(K):

    invv, i, j, k = heappop(h)

    print((inv(invv)))

    if i + 1 < X and k not in pushed[i + 1][j]:

        heappush(h, (inv(A[i + 1] + B[j] + C[k]), i + 1, j, k))

        pushed[i + 1][j].append(k)

    if j + 1 < Y and k not in pushed[i][j + 1]:

        heappush(h, (inv(A[i] + B[j + 1] + C[k]), i, j + 1, k))

        pushed[i][j + 1].append(k)

    if k + 1 < Z and k + 1 not in pushed[i][j]:

        heappush(h, (inv(A[i] + B[j] + C[k + 1]), i, j, k + 1))

        pushed[i][j].append(k + 1)
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()))
sumsofAandB = sorted([a + b for a in A for b in B], reverse=True)[:K]
sumsofAll = sorted([ab + c for ab in sumsofAandB for c in C], reverse=True)
for i in range(K):
    print((sumsofAll[i]))

from heapq import heappush, heappop

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)
h = []
maxv = A[0] + B[0] + C[0]


def inv(v):
    return maxv - v


pushed = [[[] for _ in range(Y)] for _ in range(X)]
heappush(h, (0, 0, 0, 0))
for _ in range(K):
    invv, i, j, k = heappop(h)
    print((inv(invv)))
    if i + 1 < X and k not in pushed[i + 1][j]:
        heappush(h, (inv(A[i + 1] + B[j] + C[k]), i + 1, j, k))
        pushed[i + 1][j].append(k)
    if j + 1 < Y and k not in pushed[i][j + 1]:
        heappush(h, (inv(A[i] + B[j + 1] + C[k]), i, j + 1, k))
        pushed[i][j + 1].append(k)
    if k + 1 < Z and k + 1 not in pushed[i][j]:
        heappush(h, (inv(A[i] + B[j] + C[k + 1]), i, j, k + 1))
        pushed[i][j].append(k + 1)

+from heapq import heappush, heappop + -sumsofAandB = sorted([a + b for a in A for b in B], reverse=True)[:K] -sumsofAll = sorted([ab + c for ab in sumsofAandB for c in C], reverse=True) -for i in range(K): -    print((sumsofAll[i])) +A.sort(reverse=True) +B.sort(reverse=True) +C.sort(reverse=True) +h = [] +maxv = A[0] + B[0] + C[0] + + +def inv(v): +    return maxv - v + + +pushed = [[[] for _ in range(Y)] for _ in range(X)] +heappush(h, (0, 0, 0, 0)) +for _ in range(K): +    invv, i, j, k = heappop(h) +    print((inv(invv))) +    if i + 1 < X and k not in pushed[i + 1][j]: +        heappush(h, (inv(A[i + 1] + B[j] + C[k]), i + 1, j, k)) +        pushed[i + 1][j].append(k) +    if j + 1 < Y and k not in pushed[i][j + 1]: +        heappush(h, (inv(A[i] + B[j + 1] + C[k]), i, j + 1, k)) +        pushed[i][j + 1].append(k) +    if k + 1 < Z and k + 1 not in pushed[i][j]: +        heappush(h, (inv(A[i] + B[j] + C[k + 1]), i, j, k + 1)) +        pushed[i][j].append(k + 1)