import sys

input = sys.stdin.readline



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 a in A:

    for b in B:

        AB.append(a+b)



AB.sort(reverse=True)

AB=AB[:K]



ALL=[]



for ab in AB:

    for c in C:

        ALL.append(ab+c)



ALL.sort(reverse=True)



for k in range(K):

    print((ALL[k]))
import sys

import heapq

input = sys.stdin.readline



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)





ALL=[0]*K

for a in A:

    for b in B:

        for c in C:

            if a+b+c>ALL[0]:

                heapq.heappush(ALL,a+b+c)

                heapq.heappop(ALL)

            else:

                break

                

ALL.sort(reverse=True)



for k in range(K):

    print((ALL[k]))
import sys

input = sys.stdin.readline
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 a in A:
    for b in B:
        AB.append(a + b)
AB.sort(reverse=True)
AB = AB[:K]
ALL = []
for ab in AB:
    for c in C:
        ALL.append(ab + c)
ALL.sort(reverse=True)
for k in range(K):
    print((ALL[k]))

import sys
import heapq

input = sys.stdin.readline
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)
ALL = [0] * K
for a in A:
    for b in B:
        for c in C:
            if a + b + c > ALL[0]:
                heapq.heappush(ALL, a + b + c)
                heapq.heappop(ALL)
            else:
                break
ALL.sort(reverse=True)
for k in range(K):
    print((ALL[k]))

+import heapq -AB = [] +A.sort(reverse=True) +B.sort(reverse=True) +C.sort(reverse=True) +ALL = [0] * K -        AB.append(a + b) -AB.sort(reverse=True) -AB = AB[:K] -ALL = [] -for ab in AB: -    for c in C: -        ALL.append(ab + c) +        for c in C: +            if a + b + c > ALL[0]: +                heapq.heappush(ALL, a + b + c) +                heapq.heappop(ALL) +            else: +                break