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

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

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

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



ans1 = []

for i in range(X):

    for j in range(Y):

        ans1.append(A[i] + B[j])

        

ans1 = sorted(ans1, reverse=True)[:K]



ans = []

for i in range(len(ans1)):

    for j in range(Z):

        ans.append(ans1[i] + C[j])

        

print(*sorted(ans, reverse=True)[:K], sep='\n')





X, Y, Z, K = 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):

    for j in range(Y):

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

            break



        for k in range(Z):

            if (i + 1) * (j + 1) * (k + 1) <= K:

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

            else:

                break



print(*sorted(ans, reverse=True)[:K], sep='\n')

X, Y, Z, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
ans1 = []
for i in range(X):
    for j in range(Y):
        ans1.append(A[i] + B[j])
ans1 = sorted(ans1, reverse=True)[:K]
ans = []
for i in range(len(ans1)):
    for j in range(Z):
        ans.append(ans1[i] + C[j])
print(*sorted(ans, reverse=True)[:K], sep="\n")

X, Y, Z, K = 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):
    for j in range(Y):
        if (i + 1) * (j + 1) > K:
            break
        for k in range(Z):
            if (i + 1) * (j + 1) * (k + 1) <= K:
                ans.append(A[i] + B[j] + C[k])
            else:
                break
print(*sorted(ans, reverse=True)[:K], sep="\n")

-ans1 = [] +A.sort(reverse=True) +B.sort(reverse=True) +C.sort(reverse=True) +ans = [] -        ans1.append(A[i] + B[j]) -ans1 = sorted(ans1, reverse=True)[:K] -ans = [] -for i in range(len(ans1)): -    for j in range(Z): -        ans.append(ans1[i] + C[j]) +        if (i + 1) * (j + 1) > K: +            break +        for k in range(Z): +            if (i + 1) * (j + 1) * (k + 1) <= K: +                ans.append(A[i] + B[j] + C[k]) +            else: +                break