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()))



L=[]

for a in A:

	for b in B:

		L.append(a+b)



L.sort(reverse=True)

L=L[:K]



L2=[]

for ab in L:

	for c in C:

		L2.append(ab+c)



L2.sort(reverse=True)



for i in range(K):

	print(L2[i])
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)



L=[]

for ia, a in enumerate(A):

	for ib, b in enumerate(B):

		for ic, c in enumerate(C):

			if (ia+1)*(ib+1)*(ic+1)<=K:

				L.append(a+b+c)

			else:

				break



L.sort(reverse=True)



for i in range(K):

	print(L[i])
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()))
L = []
for a in A:
    for b in B:
        L.append(a + b)
L.sort(reverse=True)
L = L[:K]
L2 = []
for ab in L:
    for c in C:
        L2.append(ab + c)
L2.sort(reverse=True)
for i in range(K):
    print(L2[i])

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)
L = []
for ia, a in enumerate(A):
    for ib, b in enumerate(B):
        for ic, c in enumerate(C):
            if (ia + 1) * (ib + 1) * (ic + 1) <= K:
                L.append(a + b + c)
            else:
                break
L.sort(reverse=True)
for i in range(K):
    print(L[i])

+A.sort(reverse=True) +B.sort(reverse=True) +C.sort(reverse=True) -for a in A: -    for b in B: -        L.append(a + b) +for ia, a in enumerate(A): +    for ib, b in enumerate(B): +        for ic, c in enumerate(C): +            if (ia + 1) * (ib + 1) * (ic + 1) <= K: +                L.append(a + b + c) +            else: +                break -L = L[:K] -L2 = [] -for ab in L: -    for c in C: -        L2.append(ab + c) -L2.sort(reverse=True) -    print(L2[i]) +    print(L[i])