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

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

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

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

lisa.sort(reverse=True)

lisb.sort(reverse=True)

lisc.sort(reverse=True)

an = []

ans = []

for num in lisb:

    for nu in lisa:

        an.append(num+nu)

an.sort(reverse=True)

an = an[:min(3001,x*y*z+1)]

for num in lisc:

    for nu in an:

        ans.append(num+nu)

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)



result = []

for i in range(X):

    for j in range(Y):

        for k in range(Z):

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

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

            else:

                break

result.sort(reverse=True)

for rs in result[:K]:

    print(rs)
x, y, z, k = list(map(int, input().split()))
lisa = list(map(int, input().split()))
lisb = list(map(int, input().split()))
lisc = list(map(int, input().split()))
lisa.sort(reverse=True)
lisb.sort(reverse=True)
lisc.sort(reverse=True)
an = []
ans = []
for num in lisb:
    for nu in lisa:
        an.append(num + nu)
an.sort(reverse=True)
an = an[: min(3001, x * y * z + 1)]
for num in lisc:
    for nu in an:
        ans.append(num + nu)
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)
result = []
for i in range(X):
    for j in range(Y):
        for k in range(Z):
            if (i + 1) * (j + 1) * (k + 1) <= K:
                result.append(A[i] + B[j] + C[k])
            else:
                break
result.sort(reverse=True)
for rs in result[:K]:
    print(rs)

-x, y, z, k = list(map(int, input().split())) -lisa = list(map(int, input().split())) -lisb = list(map(int, input().split())) -lisc = list(map(int, input().split())) -lisa.sort(reverse=True) -lisb.sort(reverse=True) -lisc.sort(reverse=True) -an = [] -ans = [] -for num in lisb: -    for nu in lisa: -        an.append(num + nu) -an.sort(reverse=True) -an = an[: min(3001, x * y * z + 1)] -for num in lisc: -    for nu in an: -        ans.append(num + nu) -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) +result = [] +for i in range(X): +    for j in range(Y): +        for k in range(Z): +            if (i + 1) * (j + 1) * (k + 1) <= K: +                result.append(A[i] + B[j] + C[k]) +            else: +                break +result.sort(reverse=True) +for rs in result[:K]: +    print(rs)