import heapq

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

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

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

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

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

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

heapq.heapify(q)

ans = []

heapq.heapify(ans)

for i in range(k):

    t, aq, bq, cq = heapq.heappop(q)

    heapq.heappush(ans, t)

    if aq + 1 < len(a):

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

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

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

    if bq + 1 < len(a):

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

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

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

    if cq + 1 < len(a):

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

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

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

for i in range(len(ans)):

    print((-heapq.heappop(ans)))

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 heapq

x, y, z, k = list(map(int, input().split()))
a = sorted(list(map(int, input().split())), reverse=True)
b = sorted(list(map(int, input().split())), reverse=True)
c = sorted(list(map(int, input().split())), reverse=True)
q = [[-(a[0] + b[0] + c[0]), 0, 0, 0]]
qh = [[-(a[0] + b[0] + c[0]), 0, 0, 0]]
heapq.heapify(q)
ans = []
heapq.heapify(ans)
for i in range(k):
    t, aq, bq, cq = heapq.heappop(q)
    heapq.heappush(ans, t)
    if aq + 1 < len(a):
        if [-(a[aq + 1] + b[bq] + c[cq]), aq + 1, bq, cq] not in qh:
            heapq.heappush(q, [-(a[aq + 1] + b[bq] + c[cq]), aq + 1, bq, cq])
            heapq.heappush(qh, [-(a[aq + 1] + b[bq] + c[cq]), aq + 1, bq, cq])
    if bq + 1 < len(a):
        if [-(a[aq] + b[bq + 1] + c[cq]), aq, bq + 1, cq] not in qh:
            heapq.heappush(q, [-(a[aq] + b[bq + 1] + c[cq]), aq, bq + 1, cq])
            heapq.heappush(qh, [-(a[aq] + b[bq + 1] + c[cq]), aq, bq + 1, cq])
    if cq + 1 < len(a):
        if [-(a[aq] + b[bq] + c[cq + 1]), aq, bq, cq + 1] not in qh:
            heapq.heappush(q, [-(a[aq] + b[bq] + c[cq + 1]), aq, bq, cq + 1])
            heapq.heappush(qh, [-(a[aq] + b[bq] + c[cq + 1]), aq, bq, cq + 1])
for i in range(len(ans)):
    print((-heapq.heappop(ans)))

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 heapq +def slove(): +    import sys +    import heapq +    import collections -x, y, z, k = list(map(int, input().split())) -a = sorted(list(map(int, input().split())), reverse=True) -b = sorted(list(map(int, input().split())), reverse=True) -c = sorted(list(map(int, input().split())), reverse=True) -q = [[-(a[0] + b[0] + c[0]), 0, 0, 0]] -qh = [[-(a[0] + b[0] + c[0]), 0, 0, 0]] -heapq.heapify(q) -ans = [] -heapq.heapify(ans) -for i in range(k): -    t, aq, bq, cq = heapq.heappop(q) -    heapq.heappush(ans, t) -    if aq + 1 < len(a): -        if [-(a[aq + 1] + b[bq] + c[cq]), aq + 1, bq, cq] not in qh: -            heapq.heappush(q, [-(a[aq + 1] + b[bq] + c[cq]), aq + 1, bq, cq]) -            heapq.heappush(qh, [-(a[aq + 1] + b[bq] + c[cq]), aq + 1, bq, cq]) -    if bq + 1 < len(a): -        if [-(a[aq] + b[bq + 1] + c[cq]), aq, bq + 1, cq] not in qh: -            heapq.heappush(q, [-(a[aq] + b[bq + 1] + c[cq]), aq, bq + 1, cq]) -            heapq.heappush(qh, [-(a[aq] + b[bq + 1] + c[cq]), aq, bq + 1, cq]) -    if cq + 1 < len(a): -        if [-(a[aq] + b[bq] + c[cq + 1]), aq, bq, cq + 1] not in qh: -            heapq.heappush(q, [-(a[aq] + b[bq] + c[cq + 1]), aq, bq, cq + 1]) -            heapq.heappush(qh, [-(a[aq] + b[bq] + c[cq + 1]), aq, bq, cq + 1]) -for i in range(len(ans)): -    print((-heapq.heappop(ans))) +    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()