from heapq import heappush, heappop



X, Y, Z, K = list(map(int, input().split()))

A = sorted(list(map(int, input().split())), reverse=True)

B = sorted(list(map(int, input().split())), reverse=True)

C = sorted(list(map(int, input().split())), reverse=True)



cake_heap = []

for i in range(len(A)):

    if i + 1 > K:

        break

    for j in range(len(B)):

        if (i + 1) * (j + 1) > K:

            break

        for k in range(len(C)):

            if (i + 1) * (j + 1) * (k + 1) > K:

                break

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

for i in range(K):

    print((-heappop(cake_heap)))

from heapq import heappush, heappop



X, Y, Z, K = list(map(int, input().split()))

A = sorted(list(map(int, input().split())), reverse=True)

B = sorted(list(map(int, input().split())), reverse=True)

C = sorted(list(map(int, input().split())), reverse=True)



h = []

minus_value = -(A[0] + B[0] + C[0])

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

searched = set()

cnt = 0

while cnt < K:

    minus_value, ia, ib, ic = heappop(h)

    if (ia, ib, ic) in searched:

        continue

    cnt += 1

    searched.add((ia, ib, ic))

    print((-minus_value))

    if ia < X - 1:

        heappush(h, (minus_value + A[ia] - A[ia + 1], ia + 1, ib, ic))

    if ib < Y - 1:

        heappush(h, (minus_value + B[ib] - B[ib + 1], ia, ib + 1, ic))

    if ic < Z - 1:

        heappush(h, (minus_value + C[ic] - C[ic + 1], ia, ib, ic + 1))

from heapq import heappush, heappop

X, Y, Z, K = list(map(int, input().split()))
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)
cake_heap = []
for i in range(len(A)):
    if i + 1 > K:
        break
    for j in range(len(B)):
        if (i + 1) * (j + 1) > K:
            break
        for k in range(len(C)):
            if (i + 1) * (j + 1) * (k + 1) > K:
                break
            heappush(cake_heap, -(A[i] + B[j] + C[k]))
for i in range(K):
    print((-heappop(cake_heap)))

from heapq import heappush, heappop

X, Y, Z, K = list(map(int, input().split()))
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)
h = []
minus_value = -(A[0] + B[0] + C[0])
heappush(h, (minus_value, 0, 0, 0))
searched = set()
cnt = 0
while cnt < K:
    minus_value, ia, ib, ic = heappop(h)
    if (ia, ib, ic) in searched:
        continue
    cnt += 1
    searched.add((ia, ib, ic))
    print((-minus_value))
    if ia < X - 1:
        heappush(h, (minus_value + A[ia] - A[ia + 1], ia + 1, ib, ic))
    if ib < Y - 1:
        heappush(h, (minus_value + B[ib] - B[ib + 1], ia, ib + 1, ic))
    if ic < Z - 1:
        heappush(h, (minus_value + C[ic] - C[ic + 1], ia, ib, ic + 1))

-cake_heap = [] -for i in range(len(A)): -    if i + 1 > K: -        break -    for j in range(len(B)): -        if (i + 1) * (j + 1) > K: -            break -        for k in range(len(C)): -            if (i + 1) * (j + 1) * (k + 1) > K: -                break -            heappush(cake_heap, -(A[i] + B[j] + C[k])) -for i in range(K): -    print((-heappop(cake_heap))) +h = [] +minus_value = -(A[0] + B[0] + C[0]) +heappush(h, (minus_value, 0, 0, 0)) +searched = set() +cnt = 0 +while cnt < K: +    minus_value, ia, ib, ic = heappop(h) +    if (ia, ib, ic) in searched: +        continue +    cnt += 1 +    searched.add((ia, ib, ic)) +    print((-minus_value)) +    if ia < X - 1: +        heappush(h, (minus_value + A[ia] - A[ia + 1], ia + 1, ib, ic)) +    if ib < Y - 1: +        heappush(h, (minus_value + B[ib] - B[ib + 1], ia, ib + 1, ic)) +    if ic < Z - 1: +        heappush(h, (minus_value + C[ic] - C[ic + 1], ia, ib, ic + 1))