

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)



result = []



for x in range(X):

  for y in range(Y):

    if x * y > K:

      break

    for z in range(Z):

      if x * y * z > K:

        break

      result.append(A[x] + B[y] + C[z])



for k in list(sorted(result, reverse=True))[:K]:

  print(k)
from heapq import heappop, heappush

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)



queue = []



for x in range(X):

  for y in range(Y):

    if x * y > K:

      break



    for z in range(Z):

      if x * y * z > K:

        break



      val = A[x] + B[y] + C[z]

      heappush(queue, -val)



for _ in range(K):

  print((-heappop(queue)))
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)
result = []
for x in range(X):
    for y in range(Y):
        if x * y > K:
            break
        for z in range(Z):
            if x * y * z > K:
                break
            result.append(A[x] + B[y] + C[z])
for k in list(sorted(result, reverse=True))[:K]:
    print(k)

from heapq import heappop, heappush

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)
queue = []
for x in range(X):
    for y in range(Y):
        if x * y > K:
            break
        for z in range(Z):
            if x * y * z > K:
                break
            val = A[x] + B[y] + C[z]
            heappush(queue, -val)
for _ in range(K):
    print((-heappop(queue)))

+from heapq import heappop, heappush + -result = [] +queue = [] -            result.append(A[x] + B[y] + C[z]) -for k in list(sorted(result, reverse=True))[:K]: -    print(k) +            val = A[x] + B[y] + C[z] +            heappush(queue, -val) +for _ in range(K): +    print((-heappop(queue)))