import heapq

X,Y,Z,K=[int(i) for i in input().split(" ")]

A=[int(i) for i in input().split(" ")]

B=[int(i) for i in input().split(" ")]

C=[int(i) for i in input().split(" ")]



AB=[]

for a in A:

    for b in B:

        AB.append(a+b)



AB=heapq.nlargest(K,AB)

ABC=[]

for ab in AB:

    for c in C:

        ABC.append(ab+c)



for cake in heapq.nlargest(K,ABC):

    print(cake)

X,Y,Z,K=[int(i) for i in input().split(" ")]

A=[int(i) for i in input().split(" ")]

B=[int(i) for i in input().split(" ")]

C=[int(i) for i in input().split(" ")]

 

AB=[]

 

A=sorted(A,reverse=True)[:K:]

B=sorted(B,reverse=True)[:K:]

C=sorted(C,reverse=True)[:K:]

for a in A:

    for b in B:

        AB.append(a+b)

 

AB=sorted(AB,reverse=True)[:K:]

 

ABC=[]

for ab in AB:

    for c in C:

        ABC.append(ab+c)

 

ABC=sorted(ABC,reverse=True)[:K:]

 

 

for abc in ABC:

    print(abc)
import heapq

X, Y, Z, K = [int(i) for i in input().split(" ")]
A = [int(i) for i in input().split(" ")]
B = [int(i) for i in input().split(" ")]
C = [int(i) for i in input().split(" ")]
AB = []
for a in A:
    for b in B:
        AB.append(a + b)
AB = heapq.nlargest(K, AB)
ABC = []
for ab in AB:
    for c in C:
        ABC.append(ab + c)
for cake in heapq.nlargest(K, ABC):
    print(cake)

X, Y, Z, K = [int(i) for i in input().split(" ")]
A = [int(i) for i in input().split(" ")]
B = [int(i) for i in input().split(" ")]
C = [int(i) for i in input().split(" ")]
AB = []
A = sorted(A, reverse=True)[:K:]
B = sorted(B, reverse=True)[:K:]
C = sorted(C, reverse=True)[:K:]
for a in A:
    for b in B:
        AB.append(a + b)
AB = sorted(AB, reverse=True)[:K:]
ABC = []
for ab in AB:
    for c in C:
        ABC.append(ab + c)
ABC = sorted(ABC, reverse=True)[:K:]
for abc in ABC:
    print(abc)

-import heapq - +A = sorted(A, reverse=True)[:K:] +B = sorted(B, reverse=True)[:K:] +C = sorted(C, reverse=True)[:K:] -AB = heapq.nlargest(K, AB) +AB = sorted(AB, reverse=True)[:K:] -for cake in heapq.nlargest(K, ABC): -    print(cake) +ABC = sorted(ABC, reverse=True)[:K:] +for abc in ABC: +    print(abc)