import sys; sys.setrecursionlimit(50000)

input = sys.stdin.readline



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

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

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

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



result = []

for x in range(X):

    for y in range(Y):

        if x * y > K: break

        for z in range(Z):

            if x * y * z > K: break

            result.append(A[x]+B[y]+C[z])

            

for i in sorted(result, reverse=True)[:K]:

    print(i)

import sys; sys.setrecursionlimit(50000)

input = sys.stdin.readline



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)



import heapq

q = []

S = set()

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

S.add((0, 0, 0))

for _ in range(K):

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

    print((-p))

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

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

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

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

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

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

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

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

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

import sys

sys.setrecursionlimit(50000)
input = sys.stdin.readline
X, Y, Z, K = list(map(int, input().split()))
A = sorted(map(int, input().split()), reverse=True)
B = sorted(map(int, input().split()), reverse=True)
C = sorted(map(int, input().split()), reverse=True)
result = []
for x in range(X):
    for y in range(Y):
        if x * y > K:
            break
        for z in range(Z):
            if x * y * z > K:
                break
            result.append(A[x] + B[y] + C[z])
for i in sorted(result, reverse=True)[:K]:
    print(i)

import sys

sys.setrecursionlimit(50000)
input = sys.stdin.readline
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)
import heapq

q = []
S = set()
heapq.heappush(q, (-(A[0] + B[0] + C[0]), 0, 0, 0))
S.add((0, 0, 0))
for _ in range(K):
    p, i, j, k = heapq.heappop(q)
    print((-p))
    if i + 1 < X and not (i + 1, j, k) in S:
        heapq.heappush(q, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k))
        S.add((i + 1, j, k))
    if j + 1 < Y and not (i, j + 1, k) in S:
        heapq.heappush(q, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k))
        S.add((i, j + 1, k))
    if k + 1 < Z and not (i, j, k + 1) in S:
        heapq.heappush(q, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1))
        S.add((i, j, k + 1))

-A = sorted(map(int, input().split()), reverse=True) -B = sorted(map(int, input().split()), reverse=True) -C = sorted(map(int, input().split()), reverse=True) -result = [] -for x in range(X): -    for y in range(Y): -        if x * y > K: -            break -        for z in range(Z): -            if x * y * z > K: -                break -            result.append(A[x] + B[y] + C[z]) -for i in sorted(result, reverse=True)[:K]: -    print(i) +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) +import heapq + +q = [] +S = set() +heapq.heappush(q, (-(A[0] + B[0] + C[0]), 0, 0, 0)) +S.add((0, 0, 0)) +for _ in range(K): +    p, i, j, k = heapq.heappop(q) +    print((-p)) +    if i + 1 < X and not (i + 1, j, k) in S: +        heapq.heappush(q, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k)) +        S.add((i + 1, j, k)) +    if j + 1 < Y and not (i, j + 1, k) in S: +        heapq.heappush(q, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k)) +        S.add((i, j + 1, k)) +    if k + 1 < Z and not (i, j, k + 1) in S: +        heapq.heappush(q, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1)) +        S.add((i, j, k + 1))