def slove():

    import sys

    import heapq

    import collections

    input = sys.stdin.readline

    x, y, z, k = list(map(int, input().rstrip('\n').split()))

    a = list(map(int, input().rstrip('\n').split()))

    a.sort(reverse=True)

    b = list(map(int, input().rstrip('\n').split()))

    b.sort(reverse=True)

    c = list(map(int, input().rstrip('\n').split()))

    c.sort(reverse=True)

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

    heapq.heapify(q)

    fq = collections.defaultdict(list)

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

    t = 0

    for _ in range(k):

        if len(q) != 0:

            p = heapq.heappop(q)

            t = p[0]

            aq = p[1]

            bq = p[2]

            cq = p[3]

            if aq + 1 < len(a):

                if (-(a[aq+1] + b[bq] + c[cq]), aq+1, bq, cq) not in fq:

                    heapq.heappush(q, [-(a[aq+1] + b[bq] + c[cq]), aq+1, bq, cq])

                    fq[(-(a[aq+1] + b[bq] + c[cq]), aq+1, bq, cq)] = 1

            if bq + 1 < len(b):

                if (-(a[aq] + b[bq+1] + c[cq]), aq, bq+1, cq) not in fq:

                    heapq.heappush(q, [-(a[aq] + b[bq+1] + c[cq]), aq, bq+1, cq])

                    fq[(-(a[aq] + b[bq+1] + c[cq]), aq, bq+1, cq)] = 1

            if cq + 1 < len(c):

                if (-(a[aq] + b[bq] + c[cq+1]), aq, bq, cq+1) not in fq:

                    heapq.heappush(q, [-(a[aq] + b[bq] + c[cq+1]), aq, bq, cq+1])

                    fq[(-(a[aq] + b[bq] + c[cq+1]), aq, bq, cq+1)] = 1

        print((-t))





if __name__ == '__main__':

    slove()

import sys

import collections

import heapq





def solve():

    input = sys.stdin.readline

    mod = 10 ** 9 + 7

    x, y, z, k = list(map(int, input().rstrip('\n').split()))

    a = list(map(int, input().rstrip('\n').split()))

    b = list(map(int, input().rstrip('\n').split()))

    c = list(map(int, input().rstrip('\n').split()))

    a.sort(reverse=True)

    b.sort(reverse=True)

    c.sort(reverse=True)

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

    heapq.heapify(ql)

    fq = collections.defaultdict(int)

    fq[0, 0, 0]

    for i in range(k):

        s, ap, bp, cp = heapq.heappop(ql)

        for app, bpp, cpp in ([[ap+1, bp, cp], [ap, bp+1, cp], [ap, bp, cp+1]]):

            if app < x and bpp < y and cpp < z:

                if (app, bpp, cpp) not in fq:

                    heapq.heappush(ql, [-(a[app] + b[bpp] + c[cpp]), app, bpp, cpp])

                    fq[app, bpp, cpp]

        print((-s))





if __name__ == '__main__':

    solve()

def slove():
    import sys
    import heapq
    import collections

    input = sys.stdin.readline
    x, y, z, k = list(map(int, input().rstrip("\n").split()))
    a = list(map(int, input().rstrip("\n").split()))
    a.sort(reverse=True)
    b = list(map(int, input().rstrip("\n").split()))
    b.sort(reverse=True)
    c = list(map(int, input().rstrip("\n").split()))
    c.sort(reverse=True)
    q = [[-(a[0] + b[0] + c[0]), 0, 0, 0]]
    heapq.heapify(q)
    fq = collections.defaultdict(list)
    fq[(-(a[0] + b[0] + c[0]), 0, 0, 0), 1] = 1
    t = 0
    for _ in range(k):
        if len(q) != 0:
            p = heapq.heappop(q)
            t = p[0]
            aq = p[1]
            bq = p[2]
            cq = p[3]
            if aq + 1 < len(a):
                if (-(a[aq + 1] + b[bq] + c[cq]), aq + 1, bq, cq) not in fq:
                    heapq.heappush(q, [-(a[aq + 1] + b[bq] + c[cq]), aq + 1, bq, cq])
                    fq[(-(a[aq + 1] + b[bq] + c[cq]), aq + 1, bq, cq)] = 1
            if bq + 1 < len(b):
                if (-(a[aq] + b[bq + 1] + c[cq]), aq, bq + 1, cq) not in fq:
                    heapq.heappush(q, [-(a[aq] + b[bq + 1] + c[cq]), aq, bq + 1, cq])
                    fq[(-(a[aq] + b[bq + 1] + c[cq]), aq, bq + 1, cq)] = 1
            if cq + 1 < len(c):
                if (-(a[aq] + b[bq] + c[cq + 1]), aq, bq, cq + 1) not in fq:
                    heapq.heappush(q, [-(a[aq] + b[bq] + c[cq + 1]), aq, bq, cq + 1])
                    fq[(-(a[aq] + b[bq] + c[cq + 1]), aq, bq, cq + 1)] = 1
        print((-t))


if __name__ == "__main__":
    slove()

import sys
import collections
import heapq


def solve():
    input = sys.stdin.readline
    mod = 10**9 + 7
    x, y, z, k = list(map(int, input().rstrip("\n").split()))
    a = list(map(int, input().rstrip("\n").split()))
    b = list(map(int, input().rstrip("\n").split()))
    c = list(map(int, input().rstrip("\n").split()))
    a.sort(reverse=True)
    b.sort(reverse=True)
    c.sort(reverse=True)
    ql = [[-(a[0] + b[0] + c[0]), 0, 0, 0]]
    heapq.heapify(ql)
    fq = collections.defaultdict(int)
    fq[0, 0, 0]
    for i in range(k):
        s, ap, bp, cp = heapq.heappop(ql)
        for app, bpp, cpp in [[ap + 1, bp, cp], [ap, bp + 1, cp], [ap, bp, cp + 1]]:
            if app < x and bpp < y and cpp < z:
                if (app, bpp, cpp) not in fq:
                    heapq.heappush(ql, [-(a[app] + b[bpp] + c[cpp]), app, bpp, cpp])
                    fq[app, bpp, cpp]
        print((-s))


if __name__ == "__main__":
    solve()

-def slove(): -    import sys -    import heapq -    import collections +import sys +import collections +import heapq + +def solve(): +    mod = 10**9 + 7 +    b = list(map(int, input().rstrip("\n").split())) +    c = list(map(int, input().rstrip("\n").split())) -    b = list(map(int, input().rstrip("\n").split())) -    c = list(map(int, input().rstrip("\n").split())) -    q = [[-(a[0] + b[0] + c[0]), 0, 0, 0]] -    heapq.heapify(q) -    fq = collections.defaultdict(list) -    fq[(-(a[0] + b[0] + c[0]), 0, 0, 0), 1] = 1 -    t = 0 -    for _ in range(k): -        if len(q) != 0: -            p = heapq.heappop(q) -            t = p[0] -            aq = p[1] -            bq = p[2] -            cq = p[3] -            if aq + 1 < len(a): -                if (-(a[aq + 1] + b[bq] + c[cq]), aq + 1, bq, cq) not in fq: -                    heapq.heappush(q, [-(a[aq + 1] + b[bq] + c[cq]), aq + 1, bq, cq]) -                    fq[(-(a[aq + 1] + b[bq] + c[cq]), aq + 1, bq, cq)] = 1 -            if bq + 1 < len(b): -                if (-(a[aq] + b[bq + 1] + c[cq]), aq, bq + 1, cq) not in fq: -                    heapq.heappush(q, [-(a[aq] + b[bq + 1] + c[cq]), aq, bq + 1, cq]) -                    fq[(-(a[aq] + b[bq + 1] + c[cq]), aq, bq + 1, cq)] = 1 -            if cq + 1 < len(c): -                if (-(a[aq] + b[bq] + c[cq + 1]), aq, bq, cq + 1) not in fq: -                    heapq.heappush(q, [-(a[aq] + b[bq] + c[cq + 1]), aq, bq, cq + 1]) -                    fq[(-(a[aq] + b[bq] + c[cq + 1]), aq, bq, cq + 1)] = 1 -        print((-t)) +    ql = [[-(a[0] + b[0] + c[0]), 0, 0, 0]] +    heapq.heapify(ql) +    fq = collections.defaultdict(int) +    fq[0, 0, 0] +    for i in range(k): +        s, ap, bp, cp = heapq.heappop(ql) +        for app, bpp, cpp in [[ap + 1, bp, cp], [ap, bp + 1, cp], [ap, bp, cp + 1]]: +            if app < x and bpp < y and cpp < z: +                if (app, bpp, cpp) not in fq: +                    heapq.heappush(ql, [-(a[app] + b[bpp] + c[cpp]), app, bpp, cpp]) +                    fq[app, bpp, cpp] +        print((-s)) -    slove() +    solve()