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

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

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

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



sumAB = sorted([ai + bi for ai in a for bi in b],reverse=True)[:k]

sumABC = sorted([ci + abi for ci in c for abi in sumAB],reverse = True)[:k]



for i in range(k):

    print((sumABC[i]))
x,y,z,k = list(map(int, input().split()))

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

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

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



ans = []

for i in range (len(a)):

    for j in range (len(b)):

        if (i+1)*(j+1)>k: break

        for u in range (len(c)):

            if (i+1)*(j+1)*(u+1)>k: break

            ans.append(a[i] + b[j] + c[u])

rans = sorted(ans,reverse = True)

for i in range(k):

    print((rans[i]))

x, y, z, k = list(map(int, input().split()))
a = sorted(list(map(int, input().split())), reverse=True)
b = sorted(list(map(int, input().split())), reverse=True)
c = sorted(list(map(int, input().split())), reverse=True)
sumAB = sorted([ai + bi for ai in a for bi in b], reverse=True)[:k]
sumABC = sorted([ci + abi for ci in c for abi in sumAB], reverse=True)[:k]
for i in range(k):
    print((sumABC[i]))

x, y, z, k = list(map(int, input().split()))
a = sorted(list(map(int, input().split())), reverse=True)
b = sorted(list(map(int, input().split())), reverse=True)
c = sorted(list(map(int, input().split())), reverse=True)
ans = []
for i in range(len(a)):
    for j in range(len(b)):
        if (i + 1) * (j + 1) > k:
            break
        for u in range(len(c)):
            if (i + 1) * (j + 1) * (u + 1) > k:
                break
            ans.append(a[i] + b[j] + c[u])
rans = sorted(ans, reverse=True)
for i in range(k):
    print((rans[i]))

-sumAB = sorted([ai + bi for ai in a for bi in b], reverse=True)[:k] -sumABC = sorted([ci + abi for ci in c for abi in sumAB], reverse=True)[:k] +ans = [] +for i in range(len(a)): +    for j in range(len(b)): +        if (i + 1) * (j + 1) > k: +            break +        for u in range(len(c)): +            if (i + 1) * (j + 1) * (u + 1) > k: +                break +            ans.append(a[i] + b[j] + c[u]) +rans = sorted(ans, reverse=True) -    print((sumABC[i])) +    print((rans[i]))