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=1)

B.sort(reverse=1)

C.sort(reverse=1)



D = [0] * (min(k, x) * min(k, y))



for i in range(min(k, x)):

    for j in range(min(k, y)):

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



D.sort(reverse=1)

E = [0] * (min(k, len(D)) * min(k, z))



for i in range(min(k, len(D))):

    for j in range(min(k, z)):

        E.append(D[i] + C[j])



E.sort(reverse=1)



for i in range(k):

    print((E[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=1)

B.sort(reverse=1)

C.sort(reverse=1)



D = []



for i in range(min(k, x)):

    for j in range(min(k, y)):

        for l in range(min(k, z)):

            if i*j*l <= k:

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

            else:

                break



D.sort(reverse=1)



for i in range(k):

    print((D[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=1)
B.sort(reverse=1)
C.sort(reverse=1)
D = [0] * (min(k, x) * min(k, y))
for i in range(min(k, x)):
    for j in range(min(k, y)):
        D.append(A[i] + B[j])
D.sort(reverse=1)
E = [0] * (min(k, len(D)) * min(k, z))
for i in range(min(k, len(D))):
    for j in range(min(k, z)):
        E.append(D[i] + C[j])
E.sort(reverse=1)
for i in range(k):
    print((E[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=1)
B.sort(reverse=1)
C.sort(reverse=1)
D = []
for i in range(min(k, x)):
    for j in range(min(k, y)):
        for l in range(min(k, z)):
            if i * j * l <= k:
                D.append(A[i] + B[j] + C[l])
            else:
                break
D.sort(reverse=1)
for i in range(k):
    print((D[i]))

-D = [0] * (min(k, x) * min(k, y)) +D = [] -        D.append(A[i] + B[j]) +        for l in range(min(k, z)): +            if i * j * l <= k: +                D.append(A[i] + B[j] + C[l]) +            else: +                break -E = [0] * (min(k, len(D)) * min(k, z)) -for i in range(min(k, len(D))): -    for j in range(min(k, z)): -        E.append(D[i] + C[j]) -E.sort(reverse=1) -    print((E[i])) +    print((D[i]))