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

A = [int(i) for i in input().split()]

B = [int(i) for i in input().split()]

C = [int(i) for i in input().split()]



A.sort(reverse=True)

B.sort(reverse=True)

C.sort(reverse=True)



x = 0

y = 0

z = 0

cakes = []

for x, a in enumerate(A):

    for y, b in enumerate(B):

        for z, c in enumerate(C):

            

            if (x+1)*(y+1)*(z+1) > k:

                break

                

            cakes.append(a+b+c)

    

cakes.sort(reverse=True)      

for cake in cakes[:k]:

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

A = [int(i) for i in input().split()]

B = [int(i) for i in input().split()]

C = [int(i) for i in input().split()]



A.sort(reverse=True)

B.sort(reverse=True)

C.sort(reverse=True)



x = 0

y = 0

z = 0

cakes = []

for x, a in enumerate(A):

    if x+1 > k: break

        

    for y, b in enumerate(B):

        if (x+1)*(y+1) > k: break

            

        for z, c in enumerate(C):

            if (x+1)*(y+1)*(z+1) > k: break

                

            cakes.append(a+b+c)

    

cakes.sort(reverse=True)      

for cake in cakes[:k]:

    print(cake)
x, y, z, k = list(map(int, input().split()))
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
x = 0
y = 0
z = 0
cakes = []
for x, a in enumerate(A):
    for y, b in enumerate(B):
        for z, c in enumerate(C):
            if (x + 1) * (y + 1) * (z + 1) > k:
                break
            cakes.append(a + b + c)
cakes.sort(reverse=True)
for cake in cakes[:k]:
    print(cake)

x, y, z, k = list(map(int, input().split()))
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
x = 0
y = 0
z = 0
cakes = []
for x, a in enumerate(A):
    if x + 1 > k:
        break
    for y, b in enumerate(B):
        if (x + 1) * (y + 1) > k:
            break
        for z, c in enumerate(C):
            if (x + 1) * (y + 1) * (z + 1) > k:
                break
            cakes.append(a + b + c)
cakes.sort(reverse=True)
for cake in cakes[:k]:
    print(cake)

+    if x + 1 > k: +        break +        if (x + 1) * (y + 1) > k: +            break