#D

from heapq import heappush,heappop

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=[]

for i in range(x):

    for j in range(y):

        heappush(d,-a[i]-b[j])

e=[]

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

    e.append(-heappop(d))

f=[]

for i in range(len(e)):

    for j in range(z):

        heappush(f,-e[i]-c[j])

for i in range(k):

    print((-heappop(f)))
#D

from heapq import heappush,heappop,heapify

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)

d=[]

for i in range(x):

    for j in range(y):

        if i*j>k:

            break

        for l in range(z):

            if i*j*l>k:

                break

            heappush(d,-a[i]-b[j]-c[l])

for i in range(k):

    print((-heappop(d)))
# D
from heapq import heappush, heappop

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 = []
for i in range(x):
    for j in range(y):
        heappush(d, -a[i] - b[j])
e = []
for i in range(min(3000, x * y)):
    e.append(-heappop(d))
f = []
for i in range(len(e)):
    for j in range(z):
        heappush(f, -e[i] - c[j])
for i in range(k):
    print((-heappop(f)))

# D
from heapq import heappush, heappop, heapify

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)
d = []
for i in range(x):
    for j in range(y):
        if i * j > k:
            break
        for l in range(z):
            if i * j * l > k:
                break
            heappush(d, -a[i] - b[j] - c[l])
for i in range(k):
    print((-heappop(d)))

-from heapq import heappush, heappop +from heapq import heappush, heappop, heapify +a.sort(reverse=True) +b.sort(reverse=True) +c.sort(reverse=True) -        heappush(d, -a[i] - b[j]) -e = [] -for i in range(min(3000, x * y)): -    e.append(-heappop(d)) -f = [] -for i in range(len(e)): -    for j in range(z): -        heappush(f, -e[i] - c[j]) +        if i * j > k: +            break +        for l in range(z): +            if i * j * l > k: +                break +            heappush(d, -a[i] - b[j] - c[l]) -    print((-heappop(f))) +    print((-heappop(d)))