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



from itertools import product

D=sorted([a+b for a,b in product(A,B)],reverse=True)

D=D[:K]

E=sorted([d+c for d,c in product(D,C)],reverse=True)

for i in range(K):

    print((E[i]))

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)



from heapq import heappop,heappush

from collections import defaultdict

f=defaultdict(int)

pq=[]



def push(a,b,c):

    if f[(a,b,c)]==0 and a<X and b<Y and c<Z:

        heappush(pq,(-(A[a]+B[b]+C[c]),a,b,c))

        f[(a,b,c)]=1



push(0,0,0)



for i in range(K):

    d,a,b,c=heappop(pq)

    print((-d))

    push(a+1,b,c)

    push(a,b+1,c)

    push(a,b,c+1)



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()))
from itertools import product

D = sorted([a + b for a, b in product(A, B)], reverse=True)
D = D[:K]
E = sorted([d + c for d, c in product(D, C)], reverse=True)
for i in range(K):
    print((E[i]))

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)
from heapq import heappop, heappush
from collections import defaultdict

f = defaultdict(int)
pq = []


def push(a, b, c):
    if f[(a, b, c)] == 0 and a < X and b < Y and c < Z:
        heappush(pq, (-(A[a] + B[b] + C[c]), a, b, c))
        f[(a, b, c)] = 1


push(0, 0, 0)
for i in range(K):
    d, a, b, c = heappop(pq)
    print((-d))
    push(a + 1, b, c)
    push(a, b + 1, c)
    push(a, b, c + 1)

-from itertools import product +A.sort(reverse=True) +B.sort(reverse=True) +C.sort(reverse=True) +from heapq import heappop, heappush +from collections import defaultdict -D = sorted([a + b for a, b in product(A, B)], reverse=True) -D = D[:K] -E = sorted([d + c for d, c in product(D, C)], reverse=True) +f = defaultdict(int) +pq = [] + + +def push(a, b, c): +    if f[(a, b, c)] == 0 and a < X and b < Y and c < Z: +        heappush(pq, (-(A[a] + B[b] + C[c]), a, b, c)) +        f[(a, b, c)] = 1 + + +push(0, 0, 0) -    print((E[i])) +    d, a, b, c = heappop(pq) +    print((-d)) +    push(a + 1, b, c) +    push(a, b + 1, c) +    push(a, b, c + 1)