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)



# 処理済みフラグ

confilm = []



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



for _ in range(K) :

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



    print((-val))



    t = (i+1,j,k)

    if i + 1 < X and not t in confilm :

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

        confilm.append(t)



    t = (i,j+1,k)

    if j + 1 < Y and not t in confilm :

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

        confilm.append(t)



    t = (i,j,k+1)

    if k + 1 < Z and not t in confilm :

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

        confilm.append(t)





from heapq import heappush, heappop



X, Y, Z, K = 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)

V = set()



que = [(-(A[0] + B[0] + C[0]), 0, 0, 0)]

V.add((0, 0, 0))

ans = []

for _ in range(K):

    val, a, b, c = heappop(que)

    ans.append(-val)



    for x, y, z in [(0, 0, 1), (0, 1, 0), (1, 0, 0)]:

        x = min(a + x, X - 1)

        y = min(b + y, Y - 1)

        z = min(c + z, Z - 1)

        if not (x, y, z) in V:

            heappush(que, (-(A[x] + B[y] + C[z]), x, y, z))

            V.add((x, y, z))



print(*ans, sep='\n')

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)
# 処理済みフラグ
confilm = []
q = [(-(A[0] + B[0] + C[0]), 0, 0, 0)]
for _ in range(K):
    val, i, j, k = heappop(q)
    print((-val))
    t = (i + 1, j, k)
    if i + 1 < X and not t in confilm:
        heappush(q, (-(A[i + 1] + B[j] + C[k]),) + t)
        confilm.append(t)
    t = (i, j + 1, k)
    if j + 1 < Y and not t in confilm:
        heappush(q, (-(A[i] + B[j + 1] + C[k]),) + t)
        confilm.append(t)
    t = (i, j, k + 1)
    if k + 1 < Z and not t in confilm:
        heappush(q, (-(A[i] + B[j] + C[k + 1]),) + t)
        confilm.append(t)

from heapq import heappush, heappop

X, Y, Z, K = 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)
V = set()
que = [(-(A[0] + B[0] + C[0]), 0, 0, 0)]
V.add((0, 0, 0))
ans = []
for _ in range(K):
    val, a, b, c = heappop(que)
    ans.append(-val)
    for x, y, z in [(0, 0, 1), (0, 1, 0), (1, 0, 0)]:
        x = min(a + x, X - 1)
        y = min(b + y, Y - 1)
        z = min(c + z, Z - 1)
        if not (x, y, z) in V:
            heappush(que, (-(A[x] + B[y] + C[z]), x, y, z))
            V.add((x, y, z))
print(*ans, sep="\n")

-from heapq import heappop, heappush +from heapq import heappush, heappop -X, Y, Z, K = list(map(int, input().split())) +X, Y, Z, K = map(int, input().split()) -# それぞれソート -# 処理済みフラグ -confilm = [] -q = [(-(A[0] + B[0] + C[0]), 0, 0, 0)] +V = set() +que = [(-(A[0] + B[0] + C[0]), 0, 0, 0)] +V.add((0, 0, 0)) +ans = [] -    val, i, j, k = heappop(q) -    print((-val)) -    t = (i + 1, j, k) -    if i + 1 < X and not t in confilm: -        heappush(q, (-(A[i + 1] + B[j] + C[k]),) + t) -        confilm.append(t) -    t = (i, j + 1, k) -    if j + 1 < Y and not t in confilm: -        heappush(q, (-(A[i] + B[j + 1] + C[k]),) + t) -        confilm.append(t) -    t = (i, j, k + 1) -    if k + 1 < Z and not t in confilm: -        heappush(q, (-(A[i] + B[j] + C[k + 1]),) + t) -        confilm.append(t) +    val, a, b, c = heappop(que) +    ans.append(-val) +    for x, y, z in [(0, 0, 1), (0, 1, 0), (1, 0, 0)]: +        x = min(a + x, X - 1) +        y = min(b + y, Y - 1) +        z = min(c + z, Z - 1) +        if not (x, y, z) in V: +            heappush(que, (-(A[x] + B[y] + C[z]), x, y, z)) +            V.add((x, y, z)) +print(*ans, sep="\n")