from queue import PriorityQueue

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)

A.append(-float('inf'))

B.sort(reverse=True)

B.append(-float('inf'))

C.sort(reverse=True)

C.append(-float('inf'))



pq = PriorityQueue()

pq.put((-(A[0]+B[0]+C[0]),0,0,0))

count = 0

queued = set([(0,0,0)])

while True:

  d,i,j,k = pq.get()

  #print(-d,i,j,k)

  print((-d))

  count += 1

  if count >= K:

    break

  for l in [i,i+1]:

    for m in [j,j+1]:

      for n in [k,k+1]:

        if (l,m,n) in queued:

          continue

        else:

          pq.put((-(A[l]+B[m]+C[n]),l,m,n))

          queued.add((l,m,n))
from heapq import heappop, heappush

from time import time



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)

A.append(-float('inf'))

B.sort(reverse=True)

B.append(-float('inf'))

C.sort(reverse=True)

C.append(-float('inf'))



hq = []

count = 0

queued = set()

heappush(hq,(-(A[0]+B[0]+C[0]),time(),0,0,0))

queued.add((0,0,0))

while True:

  d,_,i,j,k = heappop(hq)

  #print(-d,i,j,k)

  print((-d))

  count += 1

  if count >= K:

    break

  for l in [i,i+1]:

    for m in [j,j+1]:

      for n in [k,k+1]:

        if (l,m,n) in queued:

          continue

        else:

          heappush(hq,(-(A[l]+B[m]+C[n]),time(),l,m,n))

          queued.add((l,m,n))
from queue import PriorityQueue

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)
A.append(-float("inf"))
B.sort(reverse=True)
B.append(-float("inf"))
C.sort(reverse=True)
C.append(-float("inf"))
pq = PriorityQueue()
pq.put((-(A[0] + B[0] + C[0]), 0, 0, 0))
count = 0
queued = set([(0, 0, 0)])
while True:
    d, i, j, k = pq.get()
    # print(-d,i,j,k)
    print((-d))
    count += 1
    if count >= K:
        break
    for l in [i, i + 1]:
        for m in [j, j + 1]:
            for n in [k, k + 1]:
                if (l, m, n) in queued:
                    continue
                else:
                    pq.put((-(A[l] + B[m] + C[n]), l, m, n))
                    queued.add((l, m, n))

from heapq import heappop, heappush
from time import time

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)
A.append(-float("inf"))
B.sort(reverse=True)
B.append(-float("inf"))
C.sort(reverse=True)
C.append(-float("inf"))
hq = []
count = 0
queued = set()
heappush(hq, (-(A[0] + B[0] + C[0]), time(), 0, 0, 0))
queued.add((0, 0, 0))
while True:
    d, _, i, j, k = heappop(hq)
    # print(-d,i,j,k)
    print((-d))
    count += 1
    if count >= K:
        break
    for l in [i, i + 1]:
        for m in [j, j + 1]:
            for n in [k, k + 1]:
                if (l, m, n) in queued:
                    continue
                else:
                    heappush(hq, (-(A[l] + B[m] + C[n]), time(), l, m, n))
                    queued.add((l, m, n))

-from queue import PriorityQueue +from heapq import heappop, heappush +from time import time -pq = PriorityQueue() -pq.put((-(A[0] + B[0] + C[0]), 0, 0, 0)) +hq = [] -queued = set([(0, 0, 0)]) +queued = set() +heappush(hq, (-(A[0] + B[0] + C[0]), time(), 0, 0, 0)) +queued.add((0, 0, 0)) -    d, i, j, k = pq.get() +    d, _, i, j, k = heappop(hq) -                    pq.put((-(A[l] + B[m] + C[n]), l, m, n)) +                    heappush(hq, (-(A[l] + B[m] + C[n]), time(), l, m, n))