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)

t = []

for i in range(x):

    for j in range(y):

        for l in range(z):

            if (i+1) * (j+1) * (l+1) <= k:

                t.append(a[i]+b[j]+c[l])

            else:

                break

t.sort(reverse=True)

for i in range(k):

    print((t[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=True)

b.sort(reverse=True)

c.sort(reverse=True)

xl = set(range(x))

yl = set(range(y))

zl = set(range(z))

t = []

for i in xl:

    for j in yl:

        for l in zl:

            if (i+1) * (j+1) * (l+1) <= k:

                t.append(a[i]+b[j]+c[l])

            else:

                break

t.sort(reverse=True)

for i in range(k):

    print((t[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=True)
b.sort(reverse=True)
c.sort(reverse=True)
t = []
for i in range(x):
    for j in range(y):
        for l in range(z):
            if (i + 1) * (j + 1) * (l + 1) <= k:
                t.append(a[i] + b[j] + c[l])
            else:
                break
t.sort(reverse=True)
for i in range(k):
    print((t[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=True)
b.sort(reverse=True)
c.sort(reverse=True)
xl = set(range(x))
yl = set(range(y))
zl = set(range(z))
t = []
for i in xl:
    for j in yl:
        for l in zl:
            if (i + 1) * (j + 1) * (l + 1) <= k:
                t.append(a[i] + b[j] + c[l])
            else:
                break
t.sort(reverse=True)
for i in range(k):
    print((t[i]))

+xl = set(range(x)) +yl = set(range(y)) +zl = set(range(z)) -for i in range(x): -    for j in range(y): -        for l in range(z): +for i in xl: +    for j in yl: +        for l in zl: