def get_input():

    X, Y, Z, K = [int(_) for _ in input().split()]

    A = [int(_) for _ in input().split()]

    B = [int(_) for _ in input().split()]

    C = [int(_) for _ in input().split()]

    return X, Y, Z, K, A, B, C



def AddToQueue(_ele, _queue, _ijk_set, K):

    if len(_queue) == 0:

        _queue.append(_ele)

    else:

        cnt = 0

        while cnt < len(_queue) and _queue[cnt][0] >= _ele[0]:

            cnt += 1

        ijk = (_ele[1], _ele[2], _ele[3])

        if not (ijk in _ijk_set):

            _queue.insert(cnt, _ele)

            _ijk_set.add(ijk)

            _queue = _queue[:K]



def solve3():

    X, Y, Z, K, A, B, C = get_input()

    A.sort(reverse = True)

    B.sort(reverse = True)

    C.sort(reverse = True)

    ijk_set = set()

    queue = [(A[0] + B[0] + C[0], 0, 0, 0)]

    ijk_set.add((0, 0, 0))

    for cnt in range(K):

        ele, i, j, k = queue.pop(0)

        print(ele)

        if i + 1 < X:

            AddToQueue((A[i+1] + B[j] + C[k], i+1, j, k), queue, ijk_set, K)

        if j + 1 < Y:

            AddToQueue((A[i] + B[j+1] + C[k], i, j+1, k), queue, ijk_set, K)

        if k + 1 < Z:

            AddToQueue((A[i] + B[j] + C[k+1], i, j, k+1), queue, ijk_set, K)



if __name__ == '__main__':

    solve3()

def get_input():

    X, Y, Z, K = [int(_) for _ in input().split()]

    A = [int(_) for _ in input().split()]

    B = [int(_) for _ in input().split()]

    C = [int(_) for _ in input().split()]

    return X, Y, Z, K, A, B, C



def solve2():

    X, Y, Z, K, A, B, C = get_input()

    A.sort(reverse = True)

    B.sort(reverse = True)

    C.sort(reverse = True)

    sumABC = []

    for i in range(X):

        for j in range(Y):

            if (i + 1) * (j + 1) > K:

                break

            for k in range(Z):

                if (i + 1) * (j + 1) * (k + 1) > K:

                    break

                sumABC.append(A[i] + B[j] + C[k])

    sumABC.sort(reverse = True)

    for i in range(K):

        print(sumABC[i])



if __name__ == '__main__':

    solve2()
def get_input():
    X, Y, Z, K = [int(_) for _ in input().split()]
    A = [int(_) for _ in input().split()]
    B = [int(_) for _ in input().split()]
    C = [int(_) for _ in input().split()]
    return X, Y, Z, K, A, B, C


def AddToQueue(_ele, _queue, _ijk_set, K):
    if len(_queue) == 0:
        _queue.append(_ele)
    else:
        cnt = 0
        while cnt < len(_queue) and _queue[cnt][0] >= _ele[0]:
            cnt += 1
        ijk = (_ele[1], _ele[2], _ele[3])
        if not (ijk in _ijk_set):
            _queue.insert(cnt, _ele)
            _ijk_set.add(ijk)
            _queue = _queue[:K]


def solve3():
    X, Y, Z, K, A, B, C = get_input()
    A.sort(reverse=True)
    B.sort(reverse=True)
    C.sort(reverse=True)
    ijk_set = set()
    queue = [(A[0] + B[0] + C[0], 0, 0, 0)]
    ijk_set.add((0, 0, 0))
    for cnt in range(K):
        ele, i, j, k = queue.pop(0)
        print(ele)
        if i + 1 < X:
            AddToQueue((A[i + 1] + B[j] + C[k], i + 1, j, k), queue, ijk_set, K)
        if j + 1 < Y:
            AddToQueue((A[i] + B[j + 1] + C[k], i, j + 1, k), queue, ijk_set, K)
        if k + 1 < Z:
            AddToQueue((A[i] + B[j] + C[k + 1], i, j, k + 1), queue, ijk_set, K)


if __name__ == "__main__":
    solve3()

def get_input():
    X, Y, Z, K = [int(_) for _ in input().split()]
    A = [int(_) for _ in input().split()]
    B = [int(_) for _ in input().split()]
    C = [int(_) for _ in input().split()]
    return X, Y, Z, K, A, B, C


def solve2():
    X, Y, Z, K, A, B, C = get_input()
    A.sort(reverse=True)
    B.sort(reverse=True)
    C.sort(reverse=True)
    sumABC = []
    for i in range(X):
        for j in range(Y):
            if (i + 1) * (j + 1) > K:
                break
            for k in range(Z):
                if (i + 1) * (j + 1) * (k + 1) > K:
                    break
                sumABC.append(A[i] + B[j] + C[k])
    sumABC.sort(reverse=True)
    for i in range(K):
        print(sumABC[i])


if __name__ == "__main__":
    solve2()

-def AddToQueue(_ele, _queue, _ijk_set, K): -    if len(_queue) == 0: -        _queue.append(_ele) -    else: -        cnt = 0 -        while cnt < len(_queue) and _queue[cnt][0] >= _ele[0]: -            cnt += 1 -        ijk = (_ele[1], _ele[2], _ele[3]) -        if not (ijk in _ijk_set): -            _queue.insert(cnt, _ele) -            _ijk_set.add(ijk) -            _queue = _queue[:K] - - -def solve3(): +def solve2(): -    ijk_set = set() -    queue = [(A[0] + B[0] + C[0], 0, 0, 0)] -    ijk_set.add((0, 0, 0)) -    for cnt in range(K): -        ele, i, j, k = queue.pop(0) -        print(ele) -        if i + 1 < X: -            AddToQueue((A[i + 1] + B[j] + C[k], i + 1, j, k), queue, ijk_set, K) -        if j + 1 < Y: -            AddToQueue((A[i] + B[j + 1] + C[k], i, j + 1, k), queue, ijk_set, K) -        if k + 1 < Z: -            AddToQueue((A[i] + B[j] + C[k + 1], i, j, k + 1), queue, ijk_set, K) +    sumABC = [] +    for i in range(X): +        for j in range(Y): +            if (i + 1) * (j + 1) > K: +                break +            for k in range(Z): +                if (i + 1) * (j + 1) * (k + 1) > K: +                    break +                sumABC.append(A[i] + B[j] + C[k]) +    sumABC.sort(reverse=True) +    for i in range(K): +        print(sumABC[i]) -    solve3() +    solve2()