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()))



D = []

for a in A:

    for b in B:

        D.append(a + b)

D.sort(reverse=True)

if len(D) > K:

    D = D[:K]

E = []

for d in D:

    for c in C:

        E.append(c + d)



E.sort(reverse=True)

for i, e in enumerate(E):

    if i >= K:

        break

    print(e)
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)

D = []

for i in range(X):

    for j in range(Y):

        for k in range(Z):

            if i * j * k > K:

                break

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

D.sort(reverse=True)

for d in D[:K]:

    print(d)

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()))
D = []
for a in A:
    for b in B:
        D.append(a + b)
D.sort(reverse=True)
if len(D) > K:
    D = D[:K]
E = []
for d in D:
    for c in C:
        E.append(c + d)
E.sort(reverse=True)
for i, e in enumerate(E):
    if i >= K:
        break
    print(e)

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

+A.sort(reverse=True) +B.sort(reverse=True) +C.sort(reverse=True) -for a in A: -    for b in B: -        D.append(a + b) +for i in range(X): +    for j in range(Y): +        for k in range(Z): +            if i * j * k > K: +                break +            D.append(A[i] + B[j] + C[k]) -if len(D) > K: -    D = D[:K] -E = [] -for d in D: -    for c in C: -        E.append(c + d) -E.sort(reverse=True) -for i, e in enumerate(E): -    if i >= K: -        break -    print(e) +for d in D[:K]: +    print(d)