import heapq





class Delicious (object):

    def __init__(self, x, y, z):

        self.x = x

        self.y = y

        self.z = z



    def total(self):

        return(A[self.x] + B[self.y] + C[self.z])



    def __lt__(self, other):

        return self.total() > other.total()





X, Y, Z, K = list(map(int, input().split(" ")))

A = sorted(map(int, input().split(" ")), reverse=True)

B = sorted(map(int, input().split(" ")), reverse=True)

C = sorted(map(int, input().split(" ")), reverse=True)



ds = []

heapq.heappush(ds, Delicious(0, 0, 0))



check = {}



for _ in range(K):

    d = heapq.heappop(ds)

    while (d.x, d.y, d.z) in check:

        d = heapq.heappop(ds)

    print((d.total()))

    check[d.x, d.y, d.z] = True



    if d.x < X-1:

        heapq.heappush(ds, Delicious(d.x+1, d.y, d.z))

    if d.y < Y-1:

        heapq.heappush(ds, Delicious(d.x, d.y+1, d.z))

    if d.z < Z-1:

        heapq.heappush(ds, Delicious(d.x, d.y, d.z+1))

import heapq



X, Y, Z, K = list(map(int, input().split(" ")))



A = sorted(map(int, input().split(" ")), reverse=True)

B = sorted(map(int, input().split(" ")), reverse=True)

C = sorted(map(int, input().split(" ")), reverse=True)



anslist = []

flag = {}



heapq.heappush(anslist, (-(A[0]+B[0]+C[0]), (0, 0, 0)))





for _ in range(K):

    p = heapq.heappop(anslist)

    while p[1] in flag:

        p = heapq.heappop(anslist)

    print((p[0]*(-1)))

    a, b, c = p[1]

    flag[a, b, c] = True

    # push

    for i, j, k in [[1, 0, 0], [0, 1, 0], [0, 0, 1]]:

        if a+i >= X or b+j >= Y or c+k >= Z:

            continue

        tmp = (a+i, b+j, c+k)

        heapq.heappush(anslist, (-(A[a+i]+B[b+j]+C[c+k]), tmp))

import heapq


class Delicious(object):
    def __init__(self, x, y, z):
        self.x = x
        self.y = y
        self.z = z

    def total(self):
        return A[self.x] + B[self.y] + C[self.z]

    def __lt__(self, other):
        return self.total() > other.total()


X, Y, Z, K = list(map(int, input().split(" ")))
A = sorted(map(int, input().split(" ")), reverse=True)
B = sorted(map(int, input().split(" ")), reverse=True)
C = sorted(map(int, input().split(" ")), reverse=True)
ds = []
heapq.heappush(ds, Delicious(0, 0, 0))
check = {}
for _ in range(K):
    d = heapq.heappop(ds)
    while (d.x, d.y, d.z) in check:
        d = heapq.heappop(ds)
    print((d.total()))
    check[d.x, d.y, d.z] = True
    if d.x < X - 1:
        heapq.heappush(ds, Delicious(d.x + 1, d.y, d.z))
    if d.y < Y - 1:
        heapq.heappush(ds, Delicious(d.x, d.y + 1, d.z))
    if d.z < Z - 1:
        heapq.heappush(ds, Delicious(d.x, d.y, d.z + 1))

import heapq

X, Y, Z, K = list(map(int, input().split(" ")))
A = sorted(map(int, input().split(" ")), reverse=True)
B = sorted(map(int, input().split(" ")), reverse=True)
C = sorted(map(int, input().split(" ")), reverse=True)
anslist = []
flag = {}
heapq.heappush(anslist, (-(A[0] + B[0] + C[0]), (0, 0, 0)))
for _ in range(K):
    p = heapq.heappop(anslist)
    while p[1] in flag:
        p = heapq.heappop(anslist)
    print((p[0] * (-1)))
    a, b, c = p[1]
    flag[a, b, c] = True
    # push
    for i, j, k in [[1, 0, 0], [0, 1, 0], [0, 0, 1]]:
        if a + i >= X or b + j >= Y or c + k >= Z:
            continue
        tmp = (a + i, b + j, c + k)
        heapq.heappush(anslist, (-(A[a + i] + B[b + j] + C[c + k]), tmp))

- - -class Delicious(object): -    def __init__(self, x, y, z): -        self.x = x -        self.y = y -        self.z = z - -    def total(self): -        return A[self.x] + B[self.y] + C[self.z] - -    def __lt__(self, other): -        return self.total() > other.total() - -ds = [] -heapq.heappush(ds, Delicious(0, 0, 0)) -check = {} +anslist = [] +flag = {} +heapq.heappush(anslist, (-(A[0] + B[0] + C[0]), (0, 0, 0))) -    d = heapq.heappop(ds) -    while (d.x, d.y, d.z) in check: -        d = heapq.heappop(ds) -    print((d.total())) -    check[d.x, d.y, d.z] = True -    if d.x < X - 1: -        heapq.heappush(ds, Delicious(d.x + 1, d.y, d.z)) -    if d.y < Y - 1: -        heapq.heappush(ds, Delicious(d.x, d.y + 1, d.z)) -    if d.z < Z - 1: -        heapq.heappush(ds, Delicious(d.x, d.y, d.z + 1)) +    p = heapq.heappop(anslist) +    while p[1] in flag: +        p = heapq.heappop(anslist) +    print((p[0] * (-1))) +    a, b, c = p[1] +    flag[a, b, c] = True +    # push +    for i, j, k in [[1, 0, 0], [0, 1, 0], [0, 0, 1]]: +        if a + i >= X or b + j >= Y or c + k >= Z: +            continue +        tmp = (a + i, b + j, c + k) +        heapq.heappush(anslist, (-(A[a + i] + B[b + j] + C[c + k]), tmp))