import sys



input = sys.stdin.readline



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 = (aa + bb for aa in a for bb in b)

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



e = (cc + dd for cc in c for dd in d)

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



print(('\n'.join(map(str, e))))
import sys



input = sys.stdin.readline



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 = list(sorted(a, reverse=True))

b = list(sorted(b, reverse=True))

c = list(sorted(c, reverse=True))

# 降順ソート



e = []

for i, aa in enumerate(a, 1):

    for j, bb in enumerate(b, 1):

        for k, cc in enumerate(c, 1):

            if i * j * k > K: break

            e.append(aa + bb + cc)



for ee in sorted(e, reverse=True)[:K]:

    print(ee)

import sys

input = sys.stdin.readline
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 = (aa + bb for aa in a for bb in b)
d = sorted(d, reverse=True)[:K]
e = (cc + dd for cc in c for dd in d)
e = sorted(e, reverse=True)[:K]
print(("\n".join(map(str, e))))

import sys

input = sys.stdin.readline
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 = list(sorted(a, reverse=True))
b = list(sorted(b, reverse=True))
c = list(sorted(c, reverse=True))
# 降順ソート
e = []
for i, aa in enumerate(a, 1):
    for j, bb in enumerate(b, 1):
        for k, cc in enumerate(c, 1):
            if i * j * k > K:
                break
            e.append(aa + bb + cc)
for ee in sorted(e, reverse=True)[:K]:
    print(ee)

-d = (aa + bb for aa in a for bb in b) -d = sorted(d, reverse=True)[:K] -e = (cc + dd for cc in c for dd in d) -e = sorted(e, reverse=True)[:K] -print(("\n".join(map(str, e)))) +a = list(sorted(a, reverse=True)) +b = list(sorted(b, reverse=True)) +c = list(sorted(c, reverse=True)) +# 降順ソート +e = [] +for i, aa in enumerate(a, 1): +    for j, bb in enumerate(b, 1): +        for k, cc in enumerate(c, 1): +            if i * j * k > K: +                break +            e.append(aa + bb + cc) +for ee in sorted(e, reverse=True)[:K]: +    print(ee)