import heapq



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

A = sorted([int(i) for i in input().split()], reverse=True)

B = sorted([int(i) for i in input().split()], reverse=True)

C = sorted([int(i) for i in input().split()], reverse=True)



heap = []

heapq.heappush(heap, (-(A[0] + B[0] + C[0]), 0, 0, 0))

added = []

for _ in range(K):

    p, i, j, k = heapq.heappop(heap)

    if (i + 1, j, k) not in added and i + 1 < X:

        heapq.heappush(heap, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k))

        added.append((i + 1, j, k))

    if (i, j + 1, k) not in added and j + 1 < Y:

        heapq.heappush(heap, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k))

        added.append((i, j + 1, k))

    if (i, j, k + 1) not in added and k + 1 < Z:

        heapq.heappush(heap, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1))

        added.append((i, j, k + 1))

    print((-p))
import heapq



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

A = sorted([int(i) for i in input().split()], reverse=True)

B = sorted([int(i) for i in input().split()], reverse=True)

C = sorted([int(i) for i in input().split()], reverse=True)



heap = []

heapq.heappush(heap, (-(A[0] + B[0] + C[0]), 0, 0, 0))

added = set([(0, 0, 0)])

for _ in range(K):

    p, i, j, k = heapq.heappop(heap)

    if (i + 1, j, k) not in added and i + 1 < X:

        heapq.heappush(heap, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k))

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

    if (i, j + 1, k) not in added and j + 1 < Y:

        heapq.heappush(heap, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k))

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

    if (i, j, k + 1) not in added and k + 1 < Z:

        heapq.heappush(heap, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1))

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

    print((-p))
import heapq

X, Y, Z, K = list(map(int, input().split()))
A = sorted([int(i) for i in input().split()], reverse=True)
B = sorted([int(i) for i in input().split()], reverse=True)
C = sorted([int(i) for i in input().split()], reverse=True)
heap = []
heapq.heappush(heap, (-(A[0] + B[0] + C[0]), 0, 0, 0))
added = []
for _ in range(K):
    p, i, j, k = heapq.heappop(heap)
    if (i + 1, j, k) not in added and i + 1 < X:
        heapq.heappush(heap, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k))
        added.append((i + 1, j, k))
    if (i, j + 1, k) not in added and j + 1 < Y:
        heapq.heappush(heap, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k))
        added.append((i, j + 1, k))
    if (i, j, k + 1) not in added and k + 1 < Z:
        heapq.heappush(heap, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1))
        added.append((i, j, k + 1))
    print((-p))

import heapq

X, Y, Z, K = list(map(int, input().split()))
A = sorted([int(i) for i in input().split()], reverse=True)
B = sorted([int(i) for i in input().split()], reverse=True)
C = sorted([int(i) for i in input().split()], reverse=True)
heap = []
heapq.heappush(heap, (-(A[0] + B[0] + C[0]), 0, 0, 0))
added = set([(0, 0, 0)])
for _ in range(K):
    p, i, j, k = heapq.heappop(heap)
    if (i + 1, j, k) not in added and i + 1 < X:
        heapq.heappush(heap, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k))
        added.add((i + 1, j, k))
    if (i, j + 1, k) not in added and j + 1 < Y:
        heapq.heappush(heap, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k))
        added.add((i, j + 1, k))
    if (i, j, k + 1) not in added and k + 1 < Z:
        heapq.heappush(heap, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1))
        added.add((i, j, k + 1))
    print((-p))

-added = [] +added = set([(0, 0, 0)]) -        added.append((i + 1, j, k)) +        added.add((i + 1, j, k)) -        added.append((i, j + 1, k)) +        added.add((i, j + 1, k)) -        added.append((i, j, k + 1)) +        added.add((i, j, k + 1))