import heapq

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

A = sorted([int(i) for i in input().split()], reverse=True)

B = sorted([int(i) for i in input().split()], reverse=True)

C = sorted([int(i) for i in input().split()], reverse=True)



h = []

heapq.heappush(h, (-(A[0] + B[0] + C[0]), (0, 0, 0)))



ans = []

for _ in range(K):

    p, v = heapq.heappop(h)

    i, j, k = v

    ans.append(p)

    if i + 1 < X and j < Y and k < Z and not (-(A[i+1] + B[j] + C[k]), (i+1, j, k)) in h:

        heapq.heappush(h, (-(A[i + 1] + B[j] + C[k]), (i+1, j, k)))

    if i < X and j + 1 < Y and k < Z and not (-(A[i] + B[j+1] + C[k]), (i, j+1, k)) in h:

        heapq.heappush(h, (-(A[i] + B[j+1] + C[k]), (i, j+1, k)))

    if i < X and j < Y and k + 1 < Z and not (-(A[i] + B[j] + C[k+1]), (i, j, k+1)) in h:

        heapq.heappush(h, (-(A[i] + B[j] + C[k+1]), (i, j, k+1)))



for a in ans:

    print((-a))
import heapq

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

A = sorted([int(i) for i in input().split()], reverse=True)

B = sorted([int(i) for i in input().split()], reverse=True)

C = sorted([int(i) for i in input().split()], reverse=True)



h = []

heapq.heappush(h, (-(A[0] + B[0] + C[0]), (0, 0, 0)))



ans = []

e = set()

for _ in range(K):

    p, v = heapq.heappop(h)

    i, j, k = v

    ans.append(p)

    if i + 1 < X and j < Y and k < Z and not (-(A[i+1] + B[j] + C[k]), (i+1, j, k)) in e:

        heapq.heappush(h, (-(A[i + 1] + B[j] + C[k]), (i+1, j, k)))

        e.add((-(A[i + 1] + B[j] + C[k]), (i+1, j, k)))

    if i < X and j + 1 < Y and k < Z and not (-(A[i] + B[j+1] + C[k]), (i, j+1, k)) in e:

        heapq.heappush(h, (-(A[i] + B[j+1] + C[k]), (i, j+1, k)))

        e.add((-(A[i] + B[j+1] + C[k]), (i, j+1, k)))

    if i < X and j < Y and k + 1 < Z and not (-(A[i] + B[j] + C[k+1]), (i, j, k+1)) in e:

        heapq.heappush(h, (-(A[i] + B[j] + C[k+1]), (i, j, k+1)))

        e.add((-(A[i] + B[j] + C[k+1]), (i, j, k+1)))



for a in ans:

    print((-a))
import heapq

X, Y, Z, K = list(map(int, input().split()))
A = sorted([int(i) for i in input().split()], reverse=True)
B = sorted([int(i) for i in input().split()], reverse=True)
C = sorted([int(i) for i in input().split()], reverse=True)
h = []
heapq.heappush(h, (-(A[0] + B[0] + C[0]), (0, 0, 0)))
ans = []
for _ in range(K):
    p, v = heapq.heappop(h)
    i, j, k = v
    ans.append(p)
    if (
        i + 1 < X
        and j < Y
        and k < Z
        and not (-(A[i + 1] + B[j] + C[k]), (i + 1, j, k)) in h
    ):
        heapq.heappush(h, (-(A[i + 1] + B[j] + C[k]), (i + 1, j, k)))
    if (
        i < X
        and j + 1 < Y
        and k < Z
        and not (-(A[i] + B[j + 1] + C[k]), (i, j + 1, k)) in h
    ):
        heapq.heappush(h, (-(A[i] + B[j + 1] + C[k]), (i, j + 1, k)))
    if (
        i < X
        and j < Y
        and k + 1 < Z
        and not (-(A[i] + B[j] + C[k + 1]), (i, j, k + 1)) in h
    ):
        heapq.heappush(h, (-(A[i] + B[j] + C[k + 1]), (i, j, k + 1)))
for a in ans:
    print((-a))

import heapq

X, Y, Z, K = list(map(int, input().split()))
A = sorted([int(i) for i in input().split()], reverse=True)
B = sorted([int(i) for i in input().split()], reverse=True)
C = sorted([int(i) for i in input().split()], reverse=True)
h = []
heapq.heappush(h, (-(A[0] + B[0] + C[0]), (0, 0, 0)))
ans = []
e = set()
for _ in range(K):
    p, v = heapq.heappop(h)
    i, j, k = v
    ans.append(p)
    if (
        i + 1 < X
        and j < Y
        and k < Z
        and not (-(A[i + 1] + B[j] + C[k]), (i + 1, j, k)) in e
    ):
        heapq.heappush(h, (-(A[i + 1] + B[j] + C[k]), (i + 1, j, k)))
        e.add((-(A[i + 1] + B[j] + C[k]), (i + 1, j, k)))
    if (
        i < X
        and j + 1 < Y
        and k < Z
        and not (-(A[i] + B[j + 1] + C[k]), (i, j + 1, k)) in e
    ):
        heapq.heappush(h, (-(A[i] + B[j + 1] + C[k]), (i, j + 1, k)))
        e.add((-(A[i] + B[j + 1] + C[k]), (i, j + 1, k)))
    if (
        i < X
        and j < Y
        and k + 1 < Z
        and not (-(A[i] + B[j] + C[k + 1]), (i, j, k + 1)) in e
    ):
        heapq.heappush(h, (-(A[i] + B[j] + C[k + 1]), (i, j, k + 1)))
        e.add((-(A[i] + B[j] + C[k + 1]), (i, j, k + 1)))
for a in ans:
    print((-a))

+e = set() -        and not (-(A[i + 1] + B[j] + C[k]), (i + 1, j, k)) in h +        and not (-(A[i + 1] + B[j] + C[k]), (i + 1, j, k)) in e +        e.add((-(A[i + 1] + B[j] + C[k]), (i + 1, j, k))) -        and not (-(A[i] + B[j + 1] + C[k]), (i, j + 1, k)) in h +        and not (-(A[i] + B[j + 1] + C[k]), (i, j + 1, k)) in e +        e.add((-(A[i] + B[j + 1] + C[k]), (i, j + 1, k))) -        and not (-(A[i] + B[j] + C[k + 1]), (i, j, k + 1)) in h +        and not (-(A[i] + B[j] + C[k + 1]), (i, j, k + 1)) in e +        e.add((-(A[i] + B[j] + C[k + 1]), (i, j, k + 1)))