# 想定解法2



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)



ids = []

for x in range(1, X+1):

  for y in range(1, Y+1):

    if x*y > K:

        break

    for z in range(1, Z+1):

      if x*y*z <= K:

        ids.append((x-1, y-1, z-1))

      else:

        break

      

Ans = []

for x, y, z in ids:

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



Ans.sort(reverse=True)

Ans = Ans[:K]

for ans in Ans:

  print(ans)
# 想定解法3



import heapq



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)





Q =[]

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

added_idx = set((0, 0, 0))



for i in range(K):

  nega_ans, x, y, z = heapq.heappop(Q)

  print((-nega_ans))

  if x+1 < X and (x+1, y, z) not in added_idx:

    heapq.heappush(Q, [-(A[x+1]+B[y]+C[z]), x+1, y, z])

    added_idx.add((x+1, y, z))

  if y+1 < Y and (x, y+1, z) not in added_idx:

    heapq.heappush(Q, [-(A[x]+B[y+1]+C[z]), x, y+1, z])

    added_idx.add((x, y+1, z))

  if z+1 < Z and (x, y, z+1) not in added_idx:

    heapq.heappush(Q, [-(A[x]+B[y]+C[z+1]), x, y, z+1])

    added_idx.add((x, y, z+1))

# 想定解法2
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)
ids = []
for x in range(1, X + 1):
    for y in range(1, Y + 1):
        if x * y > K:
            break
        for z in range(1, Z + 1):
            if x * y * z <= K:
                ids.append((x - 1, y - 1, z - 1))
            else:
                break
Ans = []
for x, y, z in ids:
    Ans.append(A[x] + B[y] + C[z])
Ans.sort(reverse=True)
Ans = Ans[:K]
for ans in Ans:
    print(ans)

# 想定解法3
import heapq

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)
Q = []
heapq.heappush(Q, [-(A[0] + B[0] + C[0]), 0, 0, 0])
added_idx = set((0, 0, 0))
for i in range(K):
    nega_ans, x, y, z = heapq.heappop(Q)
    print((-nega_ans))
    if x + 1 < X and (x + 1, y, z) not in added_idx:
        heapq.heappush(Q, [-(A[x + 1] + B[y] + C[z]), x + 1, y, z])
        added_idx.add((x + 1, y, z))
    if y + 1 < Y and (x, y + 1, z) not in added_idx:
        heapq.heappush(Q, [-(A[x] + B[y + 1] + C[z]), x, y + 1, z])
        added_idx.add((x, y + 1, z))
    if z + 1 < Z and (x, y, z + 1) not in added_idx:
        heapq.heappush(Q, [-(A[x] + B[y] + C[z + 1]), x, y, z + 1])
        added_idx.add((x, y, z + 1))

-# 想定解法2 +# 想定解法3 +import heapq + -ids = [] -for x in range(1, X + 1): -    for y in range(1, Y + 1): -        if x * y > K: -            break -        for z in range(1, Z + 1): -            if x * y * z <= K: -                ids.append((x - 1, y - 1, z - 1)) -            else: -                break -Ans = [] -for x, y, z in ids: -    Ans.append(A[x] + B[y] + C[z]) -Ans.sort(reverse=True) -Ans = Ans[:K] -for ans in Ans: -    print(ans) +Q = [] +heapq.heappush(Q, [-(A[0] + B[0] + C[0]), 0, 0, 0]) +added_idx = set((0, 0, 0)) +for i in range(K): +    nega_ans, x, y, z = heapq.heappop(Q) +    print((-nega_ans)) +    if x + 1 < X and (x + 1, y, z) not in added_idx: +        heapq.heappush(Q, [-(A[x + 1] + B[y] + C[z]), x + 1, y, z]) +        added_idx.add((x + 1, y, z)) +    if y + 1 < Y and (x, y + 1, z) not in added_idx: +        heapq.heappush(Q, [-(A[x] + B[y + 1] + C[z]), x, y + 1, z]) +        added_idx.add((x, y + 1, z)) +    if z + 1 < Z and (x, y, z + 1) not in added_idx: +        heapq.heappush(Q, [-(A[x] + B[y] + C[z + 1]), x, y, z + 1]) +        added_idx.add((x, y, z + 1))