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

A = [int(x) for x in input().split()]

B = [int(x) for x in input().split()]

C = [int(x) for x in input().split()]



A.sort(reverse=True)

B.sort(reverse=True)

C.sort(reverse=True)



D = []

for a in A:

    for b in B:

        D.append(a + b)

D.sort(reverse=True)



D = D[:K]

E = []

for c in C:

    for d in D:

        E.append(c + d)

E.sort(reverse=True)



E = E[:K]

for e in E:

    print(e)

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

A = [int(x) for x in input().split()]

B = [int(x) for x in input().split()]

C = [int(x) for x in input().split()]



A.sort(reverse=True)

B.sort(reverse=True)

C.sort(reverse=True)



D = []

for i in range(X):

    for j in range(Y):

        if (i + 1) * (j + 1) > K:

            break

        for k in range(Z):

            if (i + 1) * (j + 1) * (k + 1) > K:

                break

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

D.sort(reverse=True)

D = D[:K]

for d in D:

    print(d)

X, Y, Z, K = list(map(int, input().split()))
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
D = []
for a in A:
    for b in B:
        D.append(a + b)
D.sort(reverse=True)
D = D[:K]
E = []
for c in C:
    for d in D:
        E.append(c + d)
E.sort(reverse=True)
E = E[:K]
for e in E:
    print(e)

X, Y, Z, K = list(map(int, input().split()))
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)
D = []
for i in range(X):
    for j in range(Y):
        if (i + 1) * (j + 1) > K:
            break
        for k in range(Z):
            if (i + 1) * (j + 1) * (k + 1) > K:
                break
            D.append(A[i] + B[j] + C[k])
D.sort(reverse=True)
D = D[:K]
for d in D:
    print(d)

-for a in A: -    for b in B: -        D.append(a + b) +for i in range(X): +    for j in range(Y): +        if (i + 1) * (j + 1) > K: +            break +        for k in range(Z): +            if (i + 1) * (j + 1) * (k + 1) > K: +                break +            D.append(A[i] + B[j] + C[k]) -E = [] -for c in C: -    for d in D: -        E.append(c + d) -E.sort(reverse=True) -E = E[:K] -for e in E: -    print(e) +for d in D: +    print(d)