import sys

input = sys.stdin.readline

from itertools import product





def read():

    X, Y, Z, K = list(map(int, input().strip().split()))

    A = list(map(int, input().strip().split()))

    B = list(map(int, input().strip().split()))

    C = list(map(int, input().strip().split()))

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





def solve(X, Y, Z, K, A, B, C, INF=10000000001):

    # 美味しさの上位K=3000件を出力する

    AB = [a+b for a, b in product(A, B)]

    AB.sort(reverse=True)

    AB = AB[:K]

    C.sort(reverse=True)



    D = [AB[k] + C[0] for k in range(len(AB))]

    E = [0 for k in range(len(AB))]

    j = 0

    for k in range(K):

        hi = 0



        # find

        for i in range(len(D)):

            if D[hi] < D[i]:

                hi = i

        # print

        print((D[hi]))



        # update

        E[hi] += 1

        if E[hi] >= len(C):

            D[hi] = -INF

        else:

            D[hi] = AB[hi] + C[E[hi]]





if __name__ == '__main__':

    inputs = read()

    solve(*inputs)

import sys

input = sys.stdin.readline

import heapq

from collections import defaultdict





def read():

    X, Y, Z, K = list(map(int, input().strip().split()))

    A = list(map(int, input().strip().split()))

    B = list(map(int, input().strip().split()))

    C = list(map(int, input().strip().split()))

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





def solve(X, Y, Z, K, A, B, C, INF=10000000001):

    A.sort(reverse=True)

    B.sort(reverse=True)

    C.sort(reverse=True)

    

    used = defaultdict(bool)

    h = []

    p, q, r = 0, 0, 0

    heapq.heappush(h, (-A[p] - B[q] - C[r], p, q, r))

    used[(p, q, r)] = True

    for k in range(K):

        a, p, q, r = heapq.heappop(h)

        print((-a))

        if p+1 < len(A) and not used[(p+1, q, r)]:

            heapq.heappush(h, (-A[p+1] - B[q] - C[r], p+1, q, r))

            used[(p+1, q, r)] = True

        if q+1 < len(B) and not used[(p, q+1, r)]:

            heapq.heappush(h, (-A[p] - B[q+1] - C[r], p, q+1, r))

            used[(p, q+1, r)] = True

        if r+1 < len(C) and not used[(p, q, r+1)]:

            heapq.heappush(h, (-A[p] - B[q] - C[r+1], p, q, r+1))

            used[(p, q, r+1)] = True





if __name__ == '__main__':

    inputs = read()

    solve(*inputs)

import sys

input = sys.stdin.readline
from itertools import product


def read():
    X, Y, Z, K = list(map(int, input().strip().split()))
    A = list(map(int, input().strip().split()))
    B = list(map(int, input().strip().split()))
    C = list(map(int, input().strip().split()))
    return X, Y, Z, K, A, B, C


def solve(X, Y, Z, K, A, B, C, INF=10000000001):
    # 美味しさの上位K=3000件を出力する
    AB = [a + b for a, b in product(A, B)]
    AB.sort(reverse=True)
    AB = AB[:K]
    C.sort(reverse=True)
    D = [AB[k] + C[0] for k in range(len(AB))]
    E = [0 for k in range(len(AB))]
    j = 0
    for k in range(K):
        hi = 0
        # find
        for i in range(len(D)):
            if D[hi] < D[i]:
                hi = i
        # print
        print((D[hi]))
        # update
        E[hi] += 1
        if E[hi] >= len(C):
            D[hi] = -INF
        else:
            D[hi] = AB[hi] + C[E[hi]]


if __name__ == "__main__":
    inputs = read()
    solve(*inputs)

import sys

input = sys.stdin.readline
import heapq
from collections import defaultdict


def read():
    X, Y, Z, K = list(map(int, input().strip().split()))
    A = list(map(int, input().strip().split()))
    B = list(map(int, input().strip().split()))
    C = list(map(int, input().strip().split()))
    return X, Y, Z, K, A, B, C


def solve(X, Y, Z, K, A, B, C, INF=10000000001):
    A.sort(reverse=True)
    B.sort(reverse=True)
    C.sort(reverse=True)
    used = defaultdict(bool)
    h = []
    p, q, r = 0, 0, 0
    heapq.heappush(h, (-A[p] - B[q] - C[r], p, q, r))
    used[(p, q, r)] = True
    for k in range(K):
        a, p, q, r = heapq.heappop(h)
        print((-a))
        if p + 1 < len(A) and not used[(p + 1, q, r)]:
            heapq.heappush(h, (-A[p + 1] - B[q] - C[r], p + 1, q, r))
            used[(p + 1, q, r)] = True
        if q + 1 < len(B) and not used[(p, q + 1, r)]:
            heapq.heappush(h, (-A[p] - B[q + 1] - C[r], p, q + 1, r))
            used[(p, q + 1, r)] = True
        if r + 1 < len(C) and not used[(p, q, r + 1)]:
            heapq.heappush(h, (-A[p] - B[q] - C[r + 1], p, q, r + 1))
            used[(p, q, r + 1)] = True


if __name__ == "__main__":
    inputs = read()
    solve(*inputs)

-from itertools import product +import heapq +from collections import defaultdict -    # 美味しさの上位K=3000件を出力する -    AB = [a + b for a, b in product(A, B)] -    AB.sort(reverse=True) -    AB = AB[:K] +    A.sort(reverse=True) +    B.sort(reverse=True) -    D = [AB[k] + C[0] for k in range(len(AB))] -    E = [0 for k in range(len(AB))] -    j = 0 +    used = defaultdict(bool) +    h = [] +    p, q, r = 0, 0, 0 +    heapq.heappush(h, (-A[p] - B[q] - C[r], p, q, r)) +    used[(p, q, r)] = True -        hi = 0 -        # find -        for i in range(len(D)): -            if D[hi] < D[i]: -                hi = i -        # print -        print((D[hi])) -        # update -        E[hi] += 1 -        if E[hi] >= len(C): -            D[hi] = -INF -        else: -            D[hi] = AB[hi] + C[E[hi]] +        a, p, q, r = heapq.heappop(h) +        print((-a)) +        if p + 1 < len(A) and not used[(p + 1, q, r)]: +            heapq.heappush(h, (-A[p + 1] - B[q] - C[r], p + 1, q, r)) +            used[(p + 1, q, r)] = True +        if q + 1 < len(B) and not used[(p, q + 1, r)]: +            heapq.heappush(h, (-A[p] - B[q + 1] - C[r], p, q + 1, r)) +            used[(p, q + 1, r)] = True +        if r + 1 < len(C) and not used[(p, q, r + 1)]: +            heapq.heappush(h, (-A[p] - B[q] - C[r + 1], p, q, r + 1)) +            used[(p, q, r + 1)] = True