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



a = sorted(A, reverse=True)

b = sorted(B, reverse=True)

c = sorted(C, reverse=True)



added = [(0, 0, 0)]

cakes = [(-(a[0] + b[0] + c[0]), 0, 0, 0)]

for k in range(K):

	v = heapq.heappop(cakes)

	print((-v[0]))

	va, vb, vc = v[1:]

	if va < X - 1 and (va + 1, vb, vc) not in added:

		heapq.heappush(cakes, (-(a[va + 1] + b[vb] + c[vc]), va + 1, vb, vc))

		added += [(va + 1, vb, vc)]

	if vb < Y - 1 and (va, vb + 1, vc) not in added:

		heapq.heappush(cakes, (-(a[va] + b[vb + 1] + c[vc]), va, vb + 1, vc))

		added += [(va, vb + 1, vc)]

	if vc < Z - 1 and (va, vb, vc + 1) not in added:

		heapq.heappush(cakes, (-(a[va] + b[vb] + c[vc + 1]), va, vb, vc + 1))

		added += [(va, vb, vc + 1)]

# データ構造：ヒープ

import heapq

class heapque:

    def __init__(self, *args):

        self.que = []

        for arg in args:

            self.push(arg)

    def push(self, v):

        heapq.heappush(self.que, v)

    def pop(self):

        return heapq.heappop(self.que)



# 定数

INF = float("inf")

MOD = int(1e9 + 7)



# エントリーポイント

def main():

    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 = sorted(A, reverse=True)

    b = sorted(B, reverse=True)

    c = sorted(C, reverse=True)

    heap = heapque((-(a[0] + b[0] + c[0]), (0, 0, 0)))

    used = {(0, 0, 0)}

    for _ in range(K):

        cur = heap.pop()

        print((-cur[0]))



        ai, bi, ci = cur[1]

        ns = ((min(ai + 1, X - 1), bi, ci), (ai, min(bi + 1, Y - 1), ci), (ai, bi, min(ci + 1, Z - 1)))

        for n in ns:

            if n in used: continue

            heap.push((-(a[n[0]] + b[n[1]] + c[n[2]]), n))

            used |= {n}



main()

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()))
a = sorted(A, reverse=True)
b = sorted(B, reverse=True)
c = sorted(C, reverse=True)
added = [(0, 0, 0)]
cakes = [(-(a[0] + b[0] + c[0]), 0, 0, 0)]
for k in range(K):
    v = heapq.heappop(cakes)
    print((-v[0]))
    va, vb, vc = v[1:]
    if va < X - 1 and (va + 1, vb, vc) not in added:
        heapq.heappush(cakes, (-(a[va + 1] + b[vb] + c[vc]), va + 1, vb, vc))
        added += [(va + 1, vb, vc)]
    if vb < Y - 1 and (va, vb + 1, vc) not in added:
        heapq.heappush(cakes, (-(a[va] + b[vb + 1] + c[vc]), va, vb + 1, vc))
        added += [(va, vb + 1, vc)]
    if vc < Z - 1 and (va, vb, vc + 1) not in added:
        heapq.heappush(cakes, (-(a[va] + b[vb] + c[vc + 1]), va, vb, vc + 1))
        added += [(va, vb, vc + 1)]

# データ構造：ヒープ
import heapq


class heapque:
    def __init__(self, *args):
        self.que = []
        for arg in args:
            self.push(arg)

    def push(self, v):
        heapq.heappush(self.que, v)

    def pop(self):
        return heapq.heappop(self.que)


# 定数
INF = float("inf")
MOD = int(1e9 + 7)
# エントリーポイント
def main():
    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 = sorted(A, reverse=True)
    b = sorted(B, reverse=True)
    c = sorted(C, reverse=True)
    heap = heapque((-(a[0] + b[0] + c[0]), (0, 0, 0)))
    used = {(0, 0, 0)}
    for _ in range(K):
        cur = heap.pop()
        print((-cur[0]))
        ai, bi, ci = cur[1]
        ns = (
            (min(ai + 1, X - 1), bi, ci),
            (ai, min(bi + 1, Y - 1), ci),
            (ai, bi, min(ci + 1, Z - 1)),
        )
        for n in ns:
            if n in used:
                continue
            heap.push((-(a[n[0]] + b[n[1]] + c[n[2]]), n))
            used |= {n}


main()

+# データ構造：ヒープ -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 = sorted(A, reverse=True) -b = sorted(B, reverse=True) -c = sorted(C, reverse=True) -added = [(0, 0, 0)] -cakes = [(-(a[0] + b[0] + c[0]), 0, 0, 0)] -for k in range(K): -    v = heapq.heappop(cakes) -    print((-v[0])) -    va, vb, vc = v[1:] -    if va < X - 1 and (va + 1, vb, vc) not in added: -        heapq.heappush(cakes, (-(a[va + 1] + b[vb] + c[vc]), va + 1, vb, vc)) -        added += [(va + 1, vb, vc)] -    if vb < Y - 1 and (va, vb + 1, vc) not in added: -        heapq.heappush(cakes, (-(a[va] + b[vb + 1] + c[vc]), va, vb + 1, vc)) -        added += [(va, vb + 1, vc)] -    if vc < Z - 1 and (va, vb, vc + 1) not in added: -        heapq.heappush(cakes, (-(a[va] + b[vb] + c[vc + 1]), va, vb, vc + 1)) -        added += [(va, vb, vc + 1)] + +class heapque: +    def __init__(self, *args): +        self.que = [] +        for arg in args: +            self.push(arg) + +    def push(self, v): +        heapq.heappush(self.que, v) + +    def pop(self): +        return heapq.heappop(self.que) + + +# 定数 +INF = float("inf") +MOD = int(1e9 + 7) +# エントリーポイント +def main(): +    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 = sorted(A, reverse=True) +    b = sorted(B, reverse=True) +    c = sorted(C, reverse=True) +    heap = heapque((-(a[0] + b[0] + c[0]), (0, 0, 0))) +    used = {(0, 0, 0)} +    for _ in range(K): +        cur = heap.pop() +        print((-cur[0])) +        ai, bi, ci = cur[1] +        ns = ( +            (min(ai + 1, X - 1), bi, ci), +            (ai, min(bi + 1, Y - 1), ci), +            (ai, bi, min(ci + 1, Z - 1)), +        ) +        for n in ns: +            if n in used: +                continue +            heap.push((-(a[n[0]] + b[n[1]] + c[n[2]]), n)) +            used |= {n} + + +main()