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)

res = []

for p in range(x):

	for q in range(y):

		if (p+1)*(q+1) > k:

			break

		for r in range(z):

			if (p+1)*(q+1)*(r+1) > k:

				break

			res.append(A[p]+B[q]+C[r])

res.sort(reverse=True)

for i in res[:k]:

	print(i)
from heapq import heappop,heappush

x,y,z,K = list(map(int,input().split()))

A = list(map(int,input().split()))

A.sort(reverse=True)

B = list(map(int,input().split()))

B.sort(reverse=True)

C = list(map(int,input().split()))

C.sort(reverse=True)



Q=[]

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

S=set()



for n in range(K):

	p,i,j,k = heappop(Q)

	print((-p))

	

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

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

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

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

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

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

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

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

		heappush(Q,(-(A[i]+B[j]+C[k+1]),i,j,k+1))
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)
res = []
for p in range(x):
    for q in range(y):
        if (p + 1) * (q + 1) > k:
            break
        for r in range(z):
            if (p + 1) * (q + 1) * (r + 1) > k:
                break
            res.append(A[p] + B[q] + C[r])
res.sort(reverse=True)
for i in res[:k]:
    print(i)

from heapq import heappop, heappush

x, y, z, K = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort(reverse=True)
B = list(map(int, input().split()))
B.sort(reverse=True)
C = list(map(int, input().split()))
C.sort(reverse=True)
Q = []
heappush(Q, (-(A[0] + B[0] + C[0]), 0, 0, 0))
S = set()
for n in range(K):
    p, i, j, k = heappop(Q)
    print((-p))
    if i + 1 < x and ((i + 1, j, k) not in S):
        S.add((i + 1, j, k))
        heappush(Q, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k))
    if j + 1 < y and ((i, j + 1, k) not in S):
        S.add((i, j + 1, k))
        heappush(Q, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k))
    if k + 1 < z and ((i, j, k + 1) not in S):
        S.add((i, j, k + 1))
        heappush(Q, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1))

-x, y, z, k = list(map(int, input().split())) +from heapq import heappop, heappush + +x, y, z, K = list(map(int, input().split())) +A.sort(reverse=True) +B.sort(reverse=True) -A.sort(reverse=True) -B.sort(reverse=True) -res = [] -for p in range(x): -    for q in range(y): -        if (p + 1) * (q + 1) > k: -            break -        for r in range(z): -            if (p + 1) * (q + 1) * (r + 1) > k: -                break -            res.append(A[p] + B[q] + C[r]) -res.sort(reverse=True) -for i in res[:k]: -    print(i) +Q = [] +heappush(Q, (-(A[0] + B[0] + C[0]), 0, 0, 0)) +S = set() +for n in range(K): +    p, i, j, k = heappop(Q) +    print((-p)) +    if i + 1 < x and ((i + 1, j, k) not in S): +        S.add((i + 1, j, k)) +        heappush(Q, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k)) +    if j + 1 < y and ((i, j + 1, k) not in S): +        S.add((i, j + 1, k)) +        heappush(Q, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k)) +    if k + 1 < z and ((i, j, k + 1) not in S): +        S.add((i, j, k + 1)) +        heappush(Q, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1))