X, Y, Z, K = list(map(int, 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 = sorted([a + b for a in A for b in B], reverse=True)[:K]

ABC = sorted([ab + c for ab in AB for c in C], reverse=True)[:K]

for a in ABC:

    print(a)

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

A = sorted([int(i) for i in input().split()], reverse=True)

B = sorted([int(i) for i in input().split()], reverse=True)

C = sorted([int(i) for i in input().split()], reverse=True)



a = []

for x in range(X):

    for y in range(Y):

        for z in range(Z):

            if ((x + 1) * (y + 1) * (z + 1) <= K):

                a.append(A[x] + B[y] + C[z])

            else:

                break



for b in sorted(a, reverse=True)[:K]:

    print(b)

X, Y, Z, K = list(map(int, 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 = sorted([a + b for a in A for b in B], reverse=True)[:K]
ABC = sorted([ab + c for ab in AB for c in C], reverse=True)[:K]
for a in ABC:
    print(a)

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

-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 = sorted([a + b for a in A for b in B], reverse=True)[:K] -ABC = sorted([ab + c for ab in AB for c in C], reverse=True)[:K] -for a in ABC: -    print(a) +A = sorted([int(i) for i in input().split()], reverse=True) +B = sorted([int(i) for i in input().split()], reverse=True) +C = sorted([int(i) for i in input().split()], reverse=True) +a = [] +for x in range(X): +    for y in range(Y): +        for z in range(Z): +            if (x + 1) * (y + 1) * (z + 1) <= K: +                a.append(A[x] + B[y] + C[z]) +            else: +                break +for b in sorted(a, reverse=True)[:K]: +    print(b)