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 i in range(X):

    for j in range(Y):

        AB.append(A[i]+B[j])



AB.sort(reverse=True)



ABC = []



for i in range(min(len(AB), K)):

    for j in range(Z):

        ABC.append(AB[i]+C[j])



ABC.sort(reverse=True)



for i in range(K):

    print((ABC[i]))
def judge(x):

    cnt = 0

    

    for i in range(X):

        for j in range(Y):

            for k in range(Z):

                if A[i]+B[j]+C[k]<x:

                    break

                

                cnt += 1

                

                if cnt>=K:

                    return True

    

    return False



def binary_search():

    l, r = 0, 10**11

    

    while l<=r:

        mid = (l+r)//2

        

        if judge(mid):

            l = mid+1

        else:

            r = mid-1

    

    return r



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)



border = binary_search()

l = []



for i in range(X):

    for j in range(Y):

        for k in range(Z):

            if A[i]+B[j]+C[k]<=border:

                break

            

            l.append(A[i]+B[j]+C[k])



if len(l)<K:

    l += [border]*(K-len(l))



l.sort(reverse=True)



for li in l:

    print(li)
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 i in range(X):
    for j in range(Y):
        AB.append(A[i] + B[j])
AB.sort(reverse=True)
ABC = []
for i in range(min(len(AB), K)):
    for j in range(Z):
        ABC.append(AB[i] + C[j])
ABC.sort(reverse=True)
for i in range(K):
    print((ABC[i]))

def judge(x):
    cnt = 0
    for i in range(X):
        for j in range(Y):
            for k in range(Z):
                if A[i] + B[j] + C[k] < x:
                    break
                cnt += 1
                if cnt >= K:
                    return True
    return False


def binary_search():
    l, r = 0, 10**11
    while l <= r:
        mid = (l + r) // 2
        if judge(mid):
            l = mid + 1
        else:
            r = mid - 1
    return r


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)
border = binary_search()
l = []
for i in range(X):
    for j in range(Y):
        for k in range(Z):
            if A[i] + B[j] + C[k] <= border:
                break
            l.append(A[i] + B[j] + C[k])
if len(l) < K:
    l += [border] * (K - len(l))
l.sort(reverse=True)
for li in l:
    print(li)

+def judge(x): +    cnt = 0 +    for i in range(X): +        for j in range(Y): +            for k in range(Z): +                if A[i] + B[j] + C[k] < x: +                    break +                cnt += 1 +                if cnt >= K: +                    return True +    return False + + +def binary_search(): +    l, r = 0, 10**11 +    while l <= r: +        mid = (l + r) // 2 +        if judge(mid): +            l = mid + 1 +        else: +            r = mid - 1 +    return r + + -AB = [] +border = binary_search() +l = [] -        AB.append(A[i] + B[j]) -AB.sort(reverse=True) -ABC = [] -for i in range(min(len(AB), K)): -    for j in range(Z): -        ABC.append(AB[i] + C[j]) -ABC.sort(reverse=True) -for i in range(K): -    print((ABC[i])) +        for k in range(Z): +            if A[i] + B[j] + C[k] <= border: +                break +            l.append(A[i] + B[j] + C[k]) +if len(l) < K: +    l += [border] * (K - len(l)) +l.sort(reverse=True) +for li in l: +    print(li)