import sys

readline = sys.stdin.readline

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

a = sorted(list(map(int, readline().split())), reverse=True)

b = sorted(list(map(int, readline().split())), reverse=True)

c = sorted(list(map(int, readline().split())), reverse=True)



ab = []

for ai in a:

    for bj in b:

        ab.append(ai+bj)

ab.sort(reverse=True)

ab = ab[:K]

cond = []

for abi in ab:

    for cj in c:

        cond.append(abi+cj)

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

for condi in cond:

    print(condi)

import sys

readline = sys.stdin.readline

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

A = sorted(list(map(int, readline().split())), reverse=True)

B = sorted(list(map(int, readline().split())), reverse=True)

C = sorted(list(map(int, readline().split())), reverse=True)



ABC = []

for a in range(X):

    for b in range(Y):

        if (a+1)*(b+1) > K:

            break

        for c in range(Z):

            if (a+1)*(b+1)*(c+1) > K:

                break

            ABC.append(A[a] + B[b] + C[c])

            

for ai in sorted(ABC, reverse=True)[:K]:

    print(ai)

import sys

readline = sys.stdin.readline
X, Y, Z, K = list(map(int, readline().split()))
a = sorted(list(map(int, readline().split())), reverse=True)
b = sorted(list(map(int, readline().split())), reverse=True)
c = sorted(list(map(int, readline().split())), reverse=True)
ab = []
for ai in a:
    for bj in b:
        ab.append(ai + bj)
ab.sort(reverse=True)
ab = ab[:K]
cond = []
for abi in ab:
    for cj in c:
        cond.append(abi + cj)
cond = sorted(cond, reverse=True)[:K]
for condi in cond:
    print(condi)

import sys

readline = sys.stdin.readline
X, Y, Z, K = list(map(int, readline().split()))
A = sorted(list(map(int, readline().split())), reverse=True)
B = sorted(list(map(int, readline().split())), reverse=True)
C = sorted(list(map(int, readline().split())), reverse=True)
ABC = []
for a in range(X):
    for b in range(Y):
        if (a + 1) * (b + 1) > K:
            break
        for c in range(Z):
            if (a + 1) * (b + 1) * (c + 1) > K:
                break
            ABC.append(A[a] + B[b] + C[c])
for ai in sorted(ABC, reverse=True)[:K]:
    print(ai)

-a = sorted(list(map(int, readline().split())), reverse=True) -b = sorted(list(map(int, readline().split())), reverse=True) -c = sorted(list(map(int, readline().split())), reverse=True) -ab = [] -for ai in a: -    for bj in b: -        ab.append(ai + bj) -ab.sort(reverse=True) -ab = ab[:K] -cond = [] -for abi in ab: -    for cj in c: -        cond.append(abi + cj) -cond = sorted(cond, reverse=True)[:K] -for condi in cond: -    print(condi) +A = sorted(list(map(int, readline().split())), reverse=True) +B = sorted(list(map(int, readline().split())), reverse=True) +C = sorted(list(map(int, readline().split())), reverse=True) +ABC = [] +for a in range(X): +    for b in range(Y): +        if (a + 1) * (b + 1) > K: +            break +        for c in range(Z): +            if (a + 1) * (b + 1) * (c + 1) > K: +                break +            ABC.append(A[a] + B[b] + C[c]) +for ai in sorted(ABC, reverse=True)[:K]: +    print(ai)