x, y, z, k = list(map(int, input().split()))



xlist = sorted(list(map(int,input().split())), reverse=True)[:min(x, k)]

ylist = sorted(list(map(int,input().split())), reverse=True)[:min(y, k)]

zlist = sorted(list(map(int,input().split())), reverse=True)[:min(z, k)]





anslist = [0]

for i in range(min(x, k)):

    for j in range(min(y, k)):

        for l in range(min(z, k)):

            if (i+1)*(j+1)*(l+1) <= k:

                anslist.append(xlist[i] + ylist[j] + zlist[l])

            else:

                break



anslist = sorted(anslist, reverse=True)

for i in range(k):

    print((anslist[i]))
import heapq

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

A=sorted(list(map(int,input().split(' '))))[::-1]

B=sorted(list(map(int,input().split(' '))))[::-1]

C=sorted(list(map(int,input().split(' '))))[::-1]



default=A[0]+B[0]+C[0]

A=[A[0]-A[i] for i in range(len(A))]

B=[B[0]-B[i] for i in range(len(B))]

C=[C[0]-C[i] for i in range(len(C))]



print(default)

hp=[]

visited=set()

visited.add((0,0,0))

a,b,c=0,0,0

for _ in range(K-1):

  if (a+1,b,c) not in visited and a+1<len(A):

    heapq.heappush(hp,(A[a+1]+B[b]+C[c],(a+1,b,c)))

    visited.add((a+1,b,c))

  if (a,b+1,c) not in visited and b+1<len(B):

    heapq.heappush(hp,(A[a]+B[b+1]+C[c],(a,b+1,c)))

    visited.add((a,b+1,c))

  if (a,b,c+1) not in visited and c+1<len(C):

    heapq.heappush(hp,(A[a]+B[b]+C[c+1],(a,b,c+1)))

    visited.add((a,b,c+1))

  temp=heapq.heappop(hp)

  print((default-temp[0]))

  a,b,c=temp[1]
x, y, z, k = list(map(int, input().split()))
xlist = sorted(list(map(int, input().split())), reverse=True)[: min(x, k)]
ylist = sorted(list(map(int, input().split())), reverse=True)[: min(y, k)]
zlist = sorted(list(map(int, input().split())), reverse=True)[: min(z, k)]
anslist = [0]
for i in range(min(x, k)):
    for j in range(min(y, k)):
        for l in range(min(z, k)):
            if (i + 1) * (j + 1) * (l + 1) <= k:
                anslist.append(xlist[i] + ylist[j] + zlist[l])
            else:
                break
anslist = sorted(anslist, reverse=True)
for i in range(k):
    print((anslist[i]))

import heapq

X, Y, Z, K = list(map(int, input().split(" ")))
A = sorted(list(map(int, input().split(" "))))[::-1]
B = sorted(list(map(int, input().split(" "))))[::-1]
C = sorted(list(map(int, input().split(" "))))[::-1]
default = A[0] + B[0] + C[0]
A = [A[0] - A[i] for i in range(len(A))]
B = [B[0] - B[i] for i in range(len(B))]
C = [C[0] - C[i] for i in range(len(C))]
print(default)
hp = []
visited = set()
visited.add((0, 0, 0))
a, b, c = 0, 0, 0
for _ in range(K - 1):
    if (a + 1, b, c) not in visited and a + 1 < len(A):
        heapq.heappush(hp, (A[a + 1] + B[b] + C[c], (a + 1, b, c)))
        visited.add((a + 1, b, c))
    if (a, b + 1, c) not in visited and b + 1 < len(B):
        heapq.heappush(hp, (A[a] + B[b + 1] + C[c], (a, b + 1, c)))
        visited.add((a, b + 1, c))
    if (a, b, c + 1) not in visited and c + 1 < len(C):
        heapq.heappush(hp, (A[a] + B[b] + C[c + 1], (a, b, c + 1)))
        visited.add((a, b, c + 1))
    temp = heapq.heappop(hp)
    print((default - temp[0]))
    a, b, c = temp[1]

-x, y, z, k = list(map(int, input().split())) -xlist = sorted(list(map(int, input().split())), reverse=True)[: min(x, k)] -ylist = sorted(list(map(int, input().split())), reverse=True)[: min(y, k)] -zlist = sorted(list(map(int, input().split())), reverse=True)[: min(z, k)] -anslist = [0] -for i in range(min(x, k)): -    for j in range(min(y, k)): -        for l in range(min(z, k)): -            if (i + 1) * (j + 1) * (l + 1) <= k: -                anslist.append(xlist[i] + ylist[j] + zlist[l]) -            else: -                break -anslist = sorted(anslist, reverse=True) -for i in range(k): -    print((anslist[i])) +import heapq + +X, Y, Z, K = list(map(int, input().split(" "))) +A = sorted(list(map(int, input().split(" "))))[::-1] +B = sorted(list(map(int, input().split(" "))))[::-1] +C = sorted(list(map(int, input().split(" "))))[::-1] +default = A[0] + B[0] + C[0] +A = [A[0] - A[i] for i in range(len(A))] +B = [B[0] - B[i] for i in range(len(B))] +C = [C[0] - C[i] for i in range(len(C))] +print(default) +hp = [] +visited = set() +visited.add((0, 0, 0)) +a, b, c = 0, 0, 0 +for _ in range(K - 1): +    if (a + 1, b, c) not in visited and a + 1 < len(A): +        heapq.heappush(hp, (A[a + 1] + B[b] + C[c], (a + 1, b, c))) +        visited.add((a + 1, b, c)) +    if (a, b + 1, c) not in visited and b + 1 < len(B): +        heapq.heappush(hp, (A[a] + B[b + 1] + C[c], (a, b + 1, c))) +        visited.add((a, b + 1, c)) +    if (a, b, c + 1) not in visited and c + 1 < len(C): +        heapq.heappush(hp, (A[a] + B[b] + C[c + 1], (a, b, c + 1))) +        visited.add((a, b, c + 1)) +    temp = heapq.heappop(hp) +    print((default - temp[0])) +    a, b, c = temp[1]