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)



ans = []



for j in range(X):

    if j+1 > K:

        break

    for k in range(Y):

        if j*k+1 > K:

            break

        for l in range(Z):

            if j*k*l+1 <= K:

                ans.append(A[j]+B[k]+C[l])

            else: 

                break

                

ans.sort(reverse=True)

for i in range(K):

    print((ans[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)

ans=[]

for i in range(X):

	j=0

	while((i+1)*(j+1)<K+1 and j<Y):

		k=0

		while((i+1)*(j+1)*(k+1)<K+1 and k<Z):

			ans.append(A[i]+B[j]+C[k])

			k+=1

		j+=1

ans.sort(reverse=True)

for i in range(K):

    print((ans[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)
ans = []
for j in range(X):
    if j + 1 > K:
        break
    for k in range(Y):
        if j * k + 1 > K:
            break
        for l in range(Z):
            if j * k * l + 1 <= K:
                ans.append(A[j] + B[k] + C[l])
            else:
                break
ans.sort(reverse=True)
for i in range(K):
    print((ans[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)
ans = []
for i in range(X):
    j = 0
    while (i + 1) * (j + 1) < K + 1 and j < Y:
        k = 0
        while (i + 1) * (j + 1) * (k + 1) < K + 1 and k < Z:
            ans.append(A[i] + B[j] + C[k])
            k += 1
        j += 1
ans.sort(reverse=True)
for i in range(K):
    print((ans[i]))

-for j in range(X): -    if j + 1 > K: -        break -    for k in range(Y): -        if j * k + 1 > K: -            break -        for l in range(Z): -            if j * k * l + 1 <= K: -                ans.append(A[j] + B[k] + C[l]) -            else: -                break +for i in range(X): +    j = 0 +    while (i + 1) * (j + 1) < K + 1 and j < Y: +        k = 0 +        while (i + 1) * (j + 1) * (k + 1) < K + 1 and k < Z: +            ans.append(A[i] + B[j] + C[k]) +            k += 1 +        j += 1