def d_cake_123_priority_queue(X, Y, Z, K, A, B, C):

    # editionalの解法3

    import heapq

    # 数列A, B, Cを降順ソート

    a, b, c = sorted(A, reverse=True), sorted(B, reverse=True), sorted(C, reverse=True)



    def evaluation(x, y, z):

        # heapqは最小値を取り出す方式なので、符号を反転させないといけない

        return (-(a[x] + b[y] + c[z]), x, y, z)



    # priority queue を定義し、(A_1 + B_1 + C_1, 1, 1, 1) を追加

    q = []

    heapq.heappush(q, evaluation(0, 0, 0))

    ans = []



    # priority queueに対するK回の操作の部分

    for _ in range(K):

        (e, x, y, z) = heapq.heappop(q)

        ans.append(-e)

        if x + 1 < X and evaluation(x + 1, y, z) not in q:

            heapq.heappush(q, evaluation(x + 1, y, z))

        if y + 1 < Y and evaluation(x, y + 1, z) not in q:

            heapq.heappush(q, evaluation(x, y + 1, z))

        if z + 1 < Z and evaluation(x, y, z + 1) not in q:

            heapq.heappush(q, evaluation(x, y, z + 1))

    return '\n'.join(map(str, ans[:K]))



X, Y, Z, K = [int(i) for i in 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()]

print((d_cake_123_priority_queue(X, Y, Z, K, A, B, C)))
def d_cake_123_priority_queue(X, Y, Z, K, A, B, C):

    # editionalの解法3

    import heapq

    # 数列A, B, Cを降順ソート

    a, b, c = sorted(A, reverse=True), sorted(B, reverse=True), sorted(C, reverse=True)



    def evaluation(x, y, z):

        # heapqは最小値を取り出す方式なので、符号を反転させないといけない

        return (-(a[x] + b[y] + c[z]), x, y, z)



    # priority queue を定義し、(A_1 + B_1 + C_1, 1, 1, 1) を追加

    q = []

    heapq.heappush(q, evaluation(0, 0, 0))

    ans = []

    memo = {(0, 0, 0): True}



    # priority queueに対するK回の操作の部分

    for _ in range(K):

        e, x, y, z = heapq.heappop(q)

        ans.append(-e)

        if x + 1 < X and (x + 1, y, z) not in memo:

            heapq.heappush(q, evaluation(x + 1, y, z))

            memo[(x + 1, y, z)] = True

        if y + 1 < Y and (x, y + 1, z) not in memo:

            heapq.heappush(q, evaluation(x, y + 1, z))

            memo[(x, y + 1, z)] = True

        if z + 1 < Z and (x, y, z + 1) not in memo:

            heapq.heappush(q, evaluation(x, y, z + 1))

            memo[(x, y, z + 1)] = True

    return '\n'.join(map(str, ans[:K]))



X, Y, Z, K = [int(i) for i in 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()]

print((d_cake_123_priority_queue(X, Y, Z, K, A, B, C)))
def d_cake_123_priority_queue(X, Y, Z, K, A, B, C):
    # editionalの解法3
    import heapq

    # 数列A, B, Cを降順ソート
    a, b, c = sorted(A, reverse=True), sorted(B, reverse=True), sorted(C, reverse=True)

    def evaluation(x, y, z):
        # heapqは最小値を取り出す方式なので、符号を反転させないといけない
        return (-(a[x] + b[y] + c[z]), x, y, z)

    # priority queue を定義し、(A_1 + B_1 + C_1, 1, 1, 1) を追加
    q = []
    heapq.heappush(q, evaluation(0, 0, 0))
    ans = []
    # priority queueに対するK回の操作の部分
    for _ in range(K):
        (e, x, y, z) = heapq.heappop(q)
        ans.append(-e)
        if x + 1 < X and evaluation(x + 1, y, z) not in q:
            heapq.heappush(q, evaluation(x + 1, y, z))
        if y + 1 < Y and evaluation(x, y + 1, z) not in q:
            heapq.heappush(q, evaluation(x, y + 1, z))
        if z + 1 < Z and evaluation(x, y, z + 1) not in q:
            heapq.heappush(q, evaluation(x, y, z + 1))
    return "\n".join(map(str, ans[:K]))


X, Y, Z, K = [int(i) for i in 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()]
print((d_cake_123_priority_queue(X, Y, Z, K, A, B, C)))

def d_cake_123_priority_queue(X, Y, Z, K, A, B, C):
    # editionalの解法3
    import heapq

    # 数列A, B, Cを降順ソート
    a, b, c = sorted(A, reverse=True), sorted(B, reverse=True), sorted(C, reverse=True)

    def evaluation(x, y, z):
        # heapqは最小値を取り出す方式なので、符号を反転させないといけない
        return (-(a[x] + b[y] + c[z]), x, y, z)

    # priority queue を定義し、(A_1 + B_1 + C_1, 1, 1, 1) を追加
    q = []
    heapq.heappush(q, evaluation(0, 0, 0))
    ans = []
    memo = {(0, 0, 0): True}
    # priority queueに対するK回の操作の部分
    for _ in range(K):
        e, x, y, z = heapq.heappop(q)
        ans.append(-e)
        if x + 1 < X and (x + 1, y, z) not in memo:
            heapq.heappush(q, evaluation(x + 1, y, z))
            memo[(x + 1, y, z)] = True
        if y + 1 < Y and (x, y + 1, z) not in memo:
            heapq.heappush(q, evaluation(x, y + 1, z))
            memo[(x, y + 1, z)] = True
        if z + 1 < Z and (x, y, z + 1) not in memo:
            heapq.heappush(q, evaluation(x, y, z + 1))
            memo[(x, y, z + 1)] = True
    return "\n".join(map(str, ans[:K]))


X, Y, Z, K = [int(i) for i in 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()]
print((d_cake_123_priority_queue(X, Y, Z, K, A, B, C)))

+    memo = {(0, 0, 0): True} -        (e, x, y, z) = heapq.heappop(q) +        e, x, y, z = heapq.heappop(q) -        if x + 1 < X and evaluation(x + 1, y, z) not in q: +        if x + 1 < X and (x + 1, y, z) not in memo: -        if y + 1 < Y and evaluation(x, y + 1, z) not in q: +            memo[(x + 1, y, z)] = True +        if y + 1 < Y and (x, y + 1, z) not in memo: -        if z + 1 < Z and evaluation(x, y, z + 1) not in q: +            memo[(x, y + 1, z)] = True +        if z + 1 < Z and (x, y, z + 1) not in memo: +            memo[(x, y, z + 1)] = True