# solution 3

import heapq

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 = []

s = []

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

for n in range(K):

    q, i, j, k = heapq.heappop(Q)

    print((-q))

    if i < X-1 and [i+1, j, k] not in s:

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

            s.append([i + 1, j, k])

    if j < Y-1 and [i, j+1, k] not in s:

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

            s.append([i, j + 1, k])

    if k < Z-1 and [i, j, k+1] not in s:

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

            s.append([i, j, k + 1])
# solution 3

import heapq

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 = []

s = set()

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

for n in range(K):

    q, i, j, k = heapq.heappop(Q)

    print((-q))

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

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

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

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

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

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

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

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

            s.add((i, j, k + 1))
# solution 3
import heapq

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

# solution 3
import heapq

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 = []
s = set()
heapq.heappush(Q, (-A[0] - B[0] - C[0], 0, 0, 0))
for n in range(K):
    q, i, j, k = heapq.heappop(Q)
    print((-q))
    if i < X - 1 and (i + 1, j, k) not in s:
        heapq.heappush(Q, (-A[i + 1] - B[j] - C[k], i + 1, j, k))
        s.add((i + 1, j, k))
    if j < Y - 1 and (i, j + 1, k) not in s:
        heapq.heappush(Q, (-A[i] - B[j + 1] - C[k], i, j + 1, k))
        s.add((i, j + 1, k))
    if k < Z - 1 and (i, j, k + 1) not in s:
        heapq.heappush(Q, (-A[i] - B[j] - C[k + 1], i, j, k + 1))
        s.add((i, j, k + 1))

-s = [] +s = set() -    if i < X - 1 and [i + 1, j, k] not in s: +    if i < X - 1 and (i + 1, j, k) not in s: -        s.append([i + 1, j, k]) -    if j < Y - 1 and [i, j + 1, k] not in s: +        s.add((i + 1, j, k)) +    if j < Y - 1 and (i, j + 1, k) not in s: -        s.append([i, j + 1, k]) -    if k < Z - 1 and [i, j, k + 1] not in s: +        s.add((i, j + 1, k)) +    if k < Z - 1 and (i, j, k + 1) not in s: -        s.append([i, j, k + 1]) +        s.add((i, j, k + 1))