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

A = list(map(int, input().split()))

A.sort(reverse=True)

B = list(map(int, input().split()))

B.sort(reverse=True)

C = list(map(int, input().split()))

C.sort(reverse=True)



AB = []

for b in B:

    for a in A:

        AB.append(a+b)

AB.sort(reverse=True)

AB = AB[:K+1]



ABC = []

for c in C:

    for ab in AB:

        ABC.append(ab+c)

ABC.sort(reverse=True)

for i in range(K):

    print((ABC[i]))
X, Y, Z, K = list(map(int, input().split()))

A = list(map(int, input().split()))

A.sort(reverse=True)

B = list(map(int, input().split()))

B.sort(reverse=True)

C = list(map(int, input().split()))

C.sort(reverse=True)



ABC = []

for xi in range(X):

    if xi+1 > K:

        break

    for yi in range(Y):

        if (xi+1)*(yi+1) > K:

            break

        for zi in range(Z):

            if (xi+1)*(yi+1)*(zi+1) > K:

                break

            ABC.append(A[xi]+B[yi]+C[zi])

ABC.sort(reverse=True)

for i in range(K):

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

X, Y, Z, K = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort(reverse=True)
B = list(map(int, input().split()))
B.sort(reverse=True)
C = list(map(int, input().split()))
C.sort(reverse=True)
ABC = []
for xi in range(X):
    if xi + 1 > K:
        break
    for yi in range(Y):
        if (xi + 1) * (yi + 1) > K:
            break
        for zi in range(Z):
            if (xi + 1) * (yi + 1) * (zi + 1) > K:
                break
            ABC.append(A[xi] + B[yi] + C[zi])
ABC.sort(reverse=True)
for i in range(K):
    print((ABC[i]))

-AB = [] -for b in B: -    for a in A: -        AB.append(a + b) -AB.sort(reverse=True) -AB = AB[: K + 1] -for c in C: -    for ab in AB: -        ABC.append(ab + c) +for xi in range(X): +    if xi + 1 > K: +        break +    for yi in range(Y): +        if (xi + 1) * (yi + 1) > K: +            break +        for zi in range(Z): +            if (xi + 1) * (yi + 1) * (zi + 1) > K: +                break +            ABC.append(A[xi] + B[yi] + C[zi])