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)



abc = []



for i in range (x):

      for j in range(y):

            for(k) in range(z):

                  if (i+1)*(j+1)*(k+1) <= K:

                        abc.append(a[i]+b[j]+c[k])

                  else:

                        break



abc.sort(reverse=True)

for i in abc[:K]:

      print(i)




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)





ans = []

for i in range(X):

    if (i+1) > K: break

    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

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



ans.sort(reverse=True)



for i in range(K):

    print((ans[i]))

            

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)
abc = []
for i in range(x):
    for j in range(y):
        for k in range(z):
            if (i + 1) * (j + 1) * (k + 1) <= K:
                abc.append(a[i] + b[j] + c[k])
            else:
                break
abc.sort(reverse=True)
for i in abc[:K]:
    print(i)

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)
ans = []
for i in range(X):
    if (i + 1) > K:
        break
    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
            ans.append(A[i] + B[j] + C[k])
ans.sort(reverse=True)
for i in range(K):
    print((ans[i]))

-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) -abc = [] -for i in range(x): -    for j in range(y): -        for k in range(z): -            if (i + 1) * (j + 1) * (k + 1) <= K: -                abc.append(a[i] + b[j] + c[k]) -            else: +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) +ans = [] +for i in range(X): +    if (i + 1) > K: +        break +    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: -abc.sort(reverse=True) -for i in abc[:K]: -    print(i) +            ans.append(A[i] + B[j] + C[k]) +ans.sort(reverse=True) +for i in range(K): +    print((ans[i]))