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



A = sorted(map(int, input().split()), reverse=True)

B = sorted(map(int, input().split()), reverse=True)

C = sorted(map(int, input().split()), 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(K, len(AB))):

    for j in range(Z):

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



ABC.sort(reverse=True)

for i in range(K):

    print((ABC[i]))

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



A = sorted(map(int, input().split()), reverse=True)

B = sorted(map(int, input().split()), reverse=True)

C = sorted(map(int, input().split()), reverse=True)



ABC = []

for a in range(X):

    for b in range(Y):

        if (a + 1) * (b + 1) > K:

            break

        for c in range(Z):

            if (a + 1) * (b + 1) * (c + 1) > K:

                break

            ABC.append(A[a] + B[b] + C[c])



ABC.sort(reverse=True)

for i in range(K):

    print((ABC[i]))

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

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

-AB = [] -for i in range(X): -    for j in range(Y): -        AB.append(A[i] + B[j]) -AB.sort(reverse=True) -for i in range(min(K, len(AB))): -    for j in range(Z): -        ABC.append(AB[i] + C[j]) +for a in range(X): +    for b in range(Y): +        if (a + 1) * (b + 1) > K: +            break +        for c in range(Z): +            if (a + 1) * (b + 1) * (c + 1) > K: +                break +            ABC.append(A[a] + B[b] + C[c])