import heapq

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

asort,bsort,csort = sorted(A,reverse=True),sorted(B,reverse=True),sorted(C,reverse=True)

already = [[0,0,0]]

print((asort[0] + bsort[0] + csort[0]))

x,y,z = 0,0,0

check = []

for k in range(K - 1):

    if [x + 1,y,z] not in already and x + 1 < X:

        already.append([x + 1,y,z])

        heapq.heappush(check,(-(asort[x + 1] + bsort[y] + csort[z]),x + 1,y,z))

    if [x,y + 1,z] not in already and y + 1 < Y:

        already.append([x,y + 1,z])

        heapq.heappush(check,(-(asort[x] + bsort[y + 1] + csort[z]),x,y + 1,z))

    if [x,y,z + 1] not in already and z + 1 < Z:

        already.append([x,y,z + 1])

        heapq.heappush(check,(-(asort[x] + bsort[y] + csort[z + 1]),x,y,z + 1))

    maxsum = heapq.heappop(check)

    print((-maxsum[0]))

    x,y,z = maxsum[1],maxsum[2],maxsum[3]
import heapq

 

_x, _y, _z, k = list(map(int, input().split()))

aa = list(reversed(sorted(map(int, input().split()))))

bb = list(reversed(sorted(map(int, input().split()))))

cc = list(reversed(sorted(map(int, input().split()))))

 

ar = []

history = set()

 

 

def push(x, y, z):

    if (x, y, z) in history:

        pass

    else:

        v = aa[x] + bb[y] + cc[z]

        heapq.heappush(ar, (-v, x, y, z))

        history.add((x, y, z))

 

 

def pop():

    (v, x, y, z) = heapq.heappop(ar)

    return (-v, x, y, z)

 

 

push(0, 0, 0)

for _ in range(k):

    (total, x, y, z) = pop()

    print(total)

    if x + 1 < len(aa):

        push(x + 1, y, z)

    if y + 1 < len(bb):

        push(x, y + 1, z)

    if z + 1 < len(cc):

        push(x, y, z + 1)
import heapq

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()))
asort, bsort, csort = (
    sorted(A, reverse=True),
    sorted(B, reverse=True),
    sorted(C, reverse=True),
)
already = [[0, 0, 0]]
print((asort[0] + bsort[0] + csort[0]))
x, y, z = 0, 0, 0
check = []
for k in range(K - 1):
    if [x + 1, y, z] not in already and x + 1 < X:
        already.append([x + 1, y, z])
        heapq.heappush(check, (-(asort[x + 1] + bsort[y] + csort[z]), x + 1, y, z))
    if [x, y + 1, z] not in already and y + 1 < Y:
        already.append([x, y + 1, z])
        heapq.heappush(check, (-(asort[x] + bsort[y + 1] + csort[z]), x, y + 1, z))
    if [x, y, z + 1] not in already and z + 1 < Z:
        already.append([x, y, z + 1])
        heapq.heappush(check, (-(asort[x] + bsort[y] + csort[z + 1]), x, y, z + 1))
    maxsum = heapq.heappop(check)
    print((-maxsum[0]))
    x, y, z = maxsum[1], maxsum[2], maxsum[3]

import heapq

_x, _y, _z, k = list(map(int, input().split()))
aa = list(reversed(sorted(map(int, input().split()))))
bb = list(reversed(sorted(map(int, input().split()))))
cc = list(reversed(sorted(map(int, input().split()))))
ar = []
history = set()


def push(x, y, z):
    if (x, y, z) in history:
        pass
    else:
        v = aa[x] + bb[y] + cc[z]
        heapq.heappush(ar, (-v, x, y, z))
        history.add((x, y, z))


def pop():
    (v, x, y, z) = heapq.heappop(ar)
    return (-v, x, y, z)


push(0, 0, 0)
for _ in range(k):
    (total, x, y, z) = pop()
    print(total)
    if x + 1 < len(aa):
        push(x + 1, y, z)
    if y + 1 < len(bb):
        push(x, y + 1, z)
    if z + 1 < len(cc):
        push(x, y, z + 1)

-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())) -asort, bsort, csort = ( -    sorted(A, reverse=True), -    sorted(B, reverse=True), -    sorted(C, reverse=True), -) -already = [[0, 0, 0]] -print((asort[0] + bsort[0] + csort[0])) -x, y, z = 0, 0, 0 -check = [] -for k in range(K - 1): -    if [x + 1, y, z] not in already and x + 1 < X: -        already.append([x + 1, y, z]) -        heapq.heappush(check, (-(asort[x + 1] + bsort[y] + csort[z]), x + 1, y, z)) -    if [x, y + 1, z] not in already and y + 1 < Y: -        already.append([x, y + 1, z]) -        heapq.heappush(check, (-(asort[x] + bsort[y + 1] + csort[z]), x, y + 1, z)) -    if [x, y, z + 1] not in already and z + 1 < Z: -        already.append([x, y, z + 1]) -        heapq.heappush(check, (-(asort[x] + bsort[y] + csort[z + 1]), x, y, z + 1)) -    maxsum = heapq.heappop(check) -    print((-maxsum[0])) -    x, y, z = maxsum[1], maxsum[2], maxsum[3] +_x, _y, _z, k = list(map(int, input().split())) +aa = list(reversed(sorted(map(int, input().split())))) +bb = list(reversed(sorted(map(int, input().split())))) +cc = list(reversed(sorted(map(int, input().split())))) +ar = [] +history = set() + + +def push(x, y, z): +    if (x, y, z) in history: +        pass +    else: +        v = aa[x] + bb[y] + cc[z] +        heapq.heappush(ar, (-v, x, y, z)) +        history.add((x, y, z)) + + +def pop(): +    (v, x, y, z) = heapq.heappop(ar) +    return (-v, x, y, z) + + +push(0, 0, 0) +for _ in range(k): +    (total, x, y, z) = pop() +    print(total) +    if x + 1 < len(aa): +        push(x + 1, y, z) +    if y + 1 < len(bb): +        push(x, y + 1, z) +    if z + 1 < len(cc): +        push(x, y, z + 1)