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



x_pls_y = []



for i in range(x):

    for j in range(y):

        x_pls_y.append(a[i]+b[j])

        

x_pls_y.sort(reverse=True)



xy_pls_z = []



for i in range(min(3000,x*y)):

    for j in range(z):

        xy_pls_z.append(x_pls_y[i]+c[j])

        

xy_pls_z.sort(reverse=True)



for i in range(k):

    print((xy_pls_z[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)



kouho = []



for i in range(x):

    for j in range(y):

        for k in range(z):

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

                break

            kouho.append(a[i]+b[j]+c[k])





kouho.sort(reverse=True)



for i in range(K):

    print((kouho[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()))
x_pls_y = []
for i in range(x):
    for j in range(y):
        x_pls_y.append(a[i] + b[j])
x_pls_y.sort(reverse=True)
xy_pls_z = []
for i in range(min(3000, x * y)):
    for j in range(z):
        xy_pls_z.append(x_pls_y[i] + c[j])
xy_pls_z.sort(reverse=True)
for i in range(k):
    print((xy_pls_z[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)
kouho = []
for i in range(x):
    for j in range(y):
        for k in range(z):
            if (i + 1) * (j + 1) * (k + 1) > K:
                break
            kouho.append(a[i] + b[j] + c[k])
kouho.sort(reverse=True)
for i in range(K):
    print((kouho[i]))

-x, y, z, k = list(map(int, input().split())) +x, y, z, K = list(map(int, input().split())) -x_pls_y = [] +a.sort(reverse=True) +b.sort(reverse=True) +c.sort(reverse=True) +kouho = [] -        x_pls_y.append(a[i] + b[j]) -x_pls_y.sort(reverse=True) -xy_pls_z = [] -for i in range(min(3000, x * y)): -    for j in range(z): -        xy_pls_z.append(x_pls_y[i] + c[j]) -xy_pls_z.sort(reverse=True) -for i in range(k): -    print((xy_pls_z[i])) +        for k in range(z): +            if (i + 1) * (j + 1) * (k + 1) > K: +                break +            kouho.append(a[i] + b[j] + c[k]) +kouho.sort(reverse=True) +for i in range(K): +    print((kouho[i]))