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)



AB = []

for a in A:

  for b in B:

    AB.append(a + b)



AB.sort(reverse=True)

AB = AB[:min(3001, X * Y * Z + 1)]

ABC = []

for c in C:

  for ab in AB:

    ABC.append(ab + c)

ABC.sort(reverse=True)



for i in range(K):

  print((ABC[i]))

from heapq import heappop, heappush



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

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

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

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

A.sort(reverse=True)

B.sort(reverse=True)

C.sort(reverse=True)



counted = set()

h = [(-(A[0] + B[0] + C[0]), 0, 0, 0)]

for _ in range(K):

    s, i, j, k = heappop(h)

    print((-s))

    if X > i + 1 and (i + 1, j, k) not in counted:

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

        counted.add((i + 1, j, k))

    if Y > j + 1 and (i, j + 1, k) not in counted:

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

        counted.add((i, j + 1, k))

    if Z > k + 1 and (i, j, k + 1) not in counted:

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

        counted.add((i, j, k + 1))

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)
AB = []
for a in A:
    for b in B:
        AB.append(a + b)
AB.sort(reverse=True)
AB = AB[: min(3001, X * Y * Z + 1)]
ABC = []
for c in C:
    for ab in AB:
        ABC.append(ab + c)
ABC.sort(reverse=True)
for i in range(K):
    print((ABC[i]))

from heapq import heappop, heappush

X, Y, Z, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
counted = set()
h = [(-(A[0] + B[0] + C[0]), 0, 0, 0)]
for _ in range(K):
    s, i, j, k = heappop(h)
    print((-s))
    if X > i + 1 and (i + 1, j, k) not in counted:
        heappush(h, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k))
        counted.add((i + 1, j, k))
    if Y > j + 1 and (i, j + 1, k) not in counted:
        heappush(h, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k))
        counted.add((i, j + 1, k))
    if Z > k + 1 and (i, j, k + 1) not in counted:
        heappush(h, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1))
        counted.add((i, j, k + 1))

+from heapq import heappop, heappush + -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) -AB = [] -for a in A: -    for b in B: -        AB.append(a + b) -AB.sort(reverse=True) -AB = AB[: min(3001, X * Y * Z + 1)] -ABC = [] -for c in C: -    for ab in AB: -        ABC.append(ab + c) -ABC.sort(reverse=True) -for i in range(K): -    print((ABC[i])) +A = list(map(int, input().split())) +B = list(map(int, input().split())) +C = list(map(int, input().split())) +A.sort(reverse=True) +B.sort(reverse=True) +C.sort(reverse=True) +counted = set() +h = [(-(A[0] + B[0] + C[0]), 0, 0, 0)] +for _ in range(K): +    s, i, j, k = heappop(h) +    print((-s)) +    if X > i + 1 and (i + 1, j, k) not in counted: +        heappush(h, (-(A[i + 1] + B[j] + C[k]), i + 1, j, k)) +        counted.add((i + 1, j, k)) +    if Y > j + 1 and (i, j + 1, k) not in counted: +        heappush(h, (-(A[i] + B[j + 1] + C[k]), i, j + 1, k)) +        counted.add((i, j + 1, k)) +    if Z > k + 1 and (i, j, k + 1) not in counted: +        heappush(h, (-(A[i] + B[j] + C[k + 1]), i, j, k + 1)) +        counted.add((i, j, k + 1))