import sys





def solve(k, ax, bx, cx):

    ab = []

    for a in ax:

        for b in bx:

            ab.append(a+b)



    ab.sort(reverse=True)

    abk = ab[:k]



    ans = []

    for c in cx:

        for abi in abk:

            ans.append(c+abi)



    return sorted(ans, reverse=True)[:k]





if __name__ == '__main__':

    _, _, _, k = map(int, input().split())

    ax = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)

    bx = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)

    cx = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)



    ans = solve(k, ax, bx, cx)



    print(*ans, sep="\n")

from heapq import heappush, heappop





def solve(k, ax, bx, cx, x, y, z):

    ans = []

    heap = [(-(ax[0] + bx[0] + cx[0]), 0, 0, 0)]

    d = {(0, 0, 0)}



    for _ in range(k):

        s, ai, bi, ci = heappop(heap)

        ans += [-s]



        if (ai+1, bi, ci) not in d and ai+1 < x:

            heappush(heap, (-(ax[ai+1] + bx[bi] + cx[ci]), ai+1, bi, ci))

            d.add((ai+1, bi, ci))

        if (ai, bi+1, ci) not in d and bi+1 < y:

            heappush(heap, (-(ax[ai] + bx[bi+1] + cx[ci]), ai, bi+1, ci))

            d.add((ai, bi+1, ci))

        if (ai, bi, ci+1) not in d and ci+1 < z:

            heappush(heap, (-(ax[ai] + bx[bi] + cx[ci+1]), ai, bi, ci+1))

            d.add((ai, bi, ci+1))



    return ans





if __name__ == "__main__":

    x, y, z, k = map(int, input().split())

    ax = sorted(list(map(int, input().split())), reverse=True)

    bx = sorted(list(map(int, input().split())), reverse=True)

    cx = sorted(list(map(int, input().split())), reverse=True)

    ans = solve(k, ax, bx, cx, x, y, z)

    print(*ans, sep="\n")

import sys


def solve(k, ax, bx, cx):
    ab = []
    for a in ax:
        for b in bx:
            ab.append(a + b)
    ab.sort(reverse=True)
    abk = ab[:k]
    ans = []
    for c in cx:
        for abi in abk:
            ans.append(c + abi)
    return sorted(ans, reverse=True)[:k]


if __name__ == "__main__":
    _, _, _, k = map(int, input().split())
    ax = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)
    bx = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)
    cx = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)
    ans = solve(k, ax, bx, cx)
    print(*ans, sep="\n")

from heapq import heappush, heappop


def solve(k, ax, bx, cx, x, y, z):
    ans = []
    heap = [(-(ax[0] + bx[0] + cx[0]), 0, 0, 0)]
    d = {(0, 0, 0)}
    for _ in range(k):
        s, ai, bi, ci = heappop(heap)
        ans += [-s]
        if (ai + 1, bi, ci) not in d and ai + 1 < x:
            heappush(heap, (-(ax[ai + 1] + bx[bi] + cx[ci]), ai + 1, bi, ci))
            d.add((ai + 1, bi, ci))
        if (ai, bi + 1, ci) not in d and bi + 1 < y:
            heappush(heap, (-(ax[ai] + bx[bi + 1] + cx[ci]), ai, bi + 1, ci))
            d.add((ai, bi + 1, ci))
        if (ai, bi, ci + 1) not in d and ci + 1 < z:
            heappush(heap, (-(ax[ai] + bx[bi] + cx[ci + 1]), ai, bi, ci + 1))
            d.add((ai, bi, ci + 1))
    return ans


if __name__ == "__main__":
    x, y, z, k = map(int, input().split())
    ax = sorted(list(map(int, input().split())), reverse=True)
    bx = sorted(list(map(int, input().split())), reverse=True)
    cx = sorted(list(map(int, input().split())), reverse=True)
    ans = solve(k, ax, bx, cx, x, y, z)
    print(*ans, sep="\n")

-import sys +from heapq import heappush, heappop -def solve(k, ax, bx, cx): -    ab = [] -    for a in ax: -        for b in bx: -            ab.append(a + b) -    ab.sort(reverse=True) -    abk = ab[:k] +def solve(k, ax, bx, cx, x, y, z): -    for c in cx: -        for abi in abk: -            ans.append(c + abi) -    return sorted(ans, reverse=True)[:k] +    heap = [(-(ax[0] + bx[0] + cx[0]), 0, 0, 0)] +    d = {(0, 0, 0)} +    for _ in range(k): +        s, ai, bi, ci = heappop(heap) +        ans += [-s] +        if (ai + 1, bi, ci) not in d and ai + 1 < x: +            heappush(heap, (-(ax[ai + 1] + bx[bi] + cx[ci]), ai + 1, bi, ci)) +            d.add((ai + 1, bi, ci)) +        if (ai, bi + 1, ci) not in d and bi + 1 < y: +            heappush(heap, (-(ax[ai] + bx[bi + 1] + cx[ci]), ai, bi + 1, ci)) +            d.add((ai, bi + 1, ci)) +        if (ai, bi, ci + 1) not in d and ci + 1 < z: +            heappush(heap, (-(ax[ai] + bx[bi] + cx[ci + 1]), ai, bi, ci + 1)) +            d.add((ai, bi, ci + 1)) +    return ans -    _, _, _, k = map(int, input().split()) -    ax = sorted(list(map(int, sys.stdin.readline().split())), reverse=True) -    bx = sorted(list(map(int, sys.stdin.readline().split())), reverse=True) -    cx = sorted(list(map(int, sys.stdin.readline().split())), reverse=True) -    ans = solve(k, ax, bx, cx) +    x, y, z, k = map(int, input().split()) +    ax = sorted(list(map(int, input().split())), reverse=True) +    bx = sorted(list(map(int, input().split())), reverse=True) +    cx = sorted(list(map(int, input().split())), reverse=True) +    ans = solve(k, ax, bx, cx, x, y, z)