import numpy as np



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

A = np.array([int(i) for i in input().split()])

B = np.array([int(i) for i in input().split()])

C =np.array([int(i) for i in input().split()])

A = -np.sort(-A) #要チェックや

B = -np.sort(-B)

C = -np.sort(-C)

D = []

for i in range(min(K, X)):

    for j in range(min(K, Y)):

        if (i + 1) * (j + 1) > K:

            break

        for k in range(min(K, Z)):

            if (i + 1) * (j + 1) * (k + 1) > K:

                break

            else:



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



X = np.array(D)

X = -np.sort(-X)

for i in range(K):

    print((X[i]))
X, Y, Z, K = list(map(int, input().split()))

A = sorted([int(i) for i in input().split()], reverse=True)

B = sorted([int(i) for i in input().split()], reverse=True)

C = sorted([int(i) for i in input().split()], reverse=True)

D = []

for i in range(min(K, X)):

    for j in range(min(K, Y)):

        if (i + 1) * (j + 1) > K:

            break

        for k in range(min(K, Z)):

            if (i + 1) * (j + 1) * (k + 1) > K:

                break

            else:



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



D.sort(reverse=True)

for i in range(K):

    print((D[i]))
import numpy as np

X, Y, Z, K = list(map(int, input().split()))
A = np.array([int(i) for i in input().split()])
B = np.array([int(i) for i in input().split()])
C = np.array([int(i) for i in input().split()])
A = -np.sort(-A)  # 要チェックや
B = -np.sort(-B)
C = -np.sort(-C)
D = []
for i in range(min(K, X)):
    for j in range(min(K, Y)):
        if (i + 1) * (j + 1) > K:
            break
        for k in range(min(K, Z)):
            if (i + 1) * (j + 1) * (k + 1) > K:
                break
            else:
                D.append(A[i] + B[j] + C[k])
X = np.array(D)
X = -np.sort(-X)
for i in range(K):
    print((X[i]))

X, Y, Z, K = list(map(int, input().split()))
A = sorted([int(i) for i in input().split()], reverse=True)
B = sorted([int(i) for i in input().split()], reverse=True)
C = sorted([int(i) for i in input().split()], reverse=True)
D = []
for i in range(min(K, X)):
    for j in range(min(K, Y)):
        if (i + 1) * (j + 1) > K:
            break
        for k in range(min(K, Z)):
            if (i + 1) * (j + 1) * (k + 1) > K:
                break
            else:
                D.append(A[i] + B[j] + C[k])
D.sort(reverse=True)
for i in range(K):
    print((D[i]))

-import numpy as np - -A = np.array([int(i) for i in input().split()]) -B = np.array([int(i) for i in input().split()]) -C = np.array([int(i) for i in input().split()]) -A = -np.sort(-A)  # 要チェックや -B = -np.sort(-B) -C = -np.sort(-C) +A = sorted([int(i) for i in input().split()], reverse=True) +B = sorted([int(i) for i in input().split()], reverse=True) +C = sorted([int(i) for i in input().split()], reverse=True) -X = np.array(D) -X = -np.sort(-X) +D.sort(reverse=True) -    print((X[i])) +    print((D[i]))