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()))



AB=[]

for i in A:

  for j in B:

    heapq.heappush(AB,-i-j)

#print(AB)



ABC=[]

for i in range(min(K,X*Y)):

  temp=heapq.heappop(AB)

  for j in C:

    heapq.heappush(ABC,temp-j)



for i in range(min(K,X*Y*Z)):

  print((-heapq.heappop(ABC)))

    
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)



AB = []

for a in A:

  for b in B:

    AB.append(a + b)

AB.sort(reverse = True)

AB = AB[:3000]



ABC = []

for ab in AB:

  for c in C:

    ABC.append(ab + c)

ABC.sort(reverse = True)



for i in range(K):

  print((ABC[i]))
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()))
AB = []
for i in A:
    for j in B:
        heapq.heappush(AB, -i - j)
# print(AB)
ABC = []
for i in range(min(K, X * Y)):
    temp = heapq.heappop(AB)
    for j in C:
        heapq.heappush(ABC, temp - j)
for i in range(min(K, X * Y * Z)):
    print((-heapq.heappop(ABC)))

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)
AB = []
for a in A:
    for b in B:
        AB.append(a + b)
AB.sort(reverse=True)
AB = AB[:3000]
ABC = []
for ab in AB:
    for c in C:
        ABC.append(ab + c)
ABC.sort(reverse=True)
for i in range(K):
    print((ABC[i]))

-import heapq - +A.sort(reverse=True) +B.sort(reverse=True) +C.sort(reverse=True) -for i in A: -    for j in B: -        heapq.heappush(AB, -i - j) -# print(AB) +for a in A: +    for b in B: +        AB.append(a + b) +AB.sort(reverse=True) +AB = AB[:3000] -for i in range(min(K, X * Y)): -    temp = heapq.heappop(AB) -    for j in C: -        heapq.heappush(ABC, temp - j) -for i in range(min(K, X * Y * Z)): -    print((-heapq.heappop(ABC))) +for ab in AB: +    for c in C: +        ABC.append(ab + c) +ABC.sort(reverse=True) +for i in range(K): +    print((ABC[i]))