def main():

  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)

  A += [-1e10]

  B += [-1e10]

  C += [-1e10]



  memo = [A[i] + B[0] + C[0] for i in range(X + 1)]

  L = [[0 for i in range(Y + 1)] for j in range(X + 1)]



  for i in range(K):

    ma = 0

    for j in range(X):

      if memo[ma] < memo[j]:

        ma = j

    print((memo[ma]))

    mb = 0

    mn = 0

    for j in range(Y):

      x = B[j] + C[L[ma][j]]

      if mb < x:

        mb = x

        mn = j

    L[ma][mn] += 1

    n = 0

    for j in range(Y):

      n = max(n, B[j] + C[L[ma][j]])

    memo[ma] = A[ma] + n

 

main()
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):

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

      break

    for k in range(Z):

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

        break

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

    

abc.sort(reverse = True)

for i in range(K):

  print((abc[i]))

def main():
    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)
    A += [-1e10]
    B += [-1e10]
    C += [-1e10]
    memo = [A[i] + B[0] + C[0] for i in range(X + 1)]
    L = [[0 for i in range(Y + 1)] for j in range(X + 1)]
    for i in range(K):
        ma = 0
        for j in range(X):
            if memo[ma] < memo[j]:
                ma = j
        print((memo[ma]))
        mb = 0
        mn = 0
        for j in range(Y):
            x = B[j] + C[L[ma][j]]
            if mb < x:
                mb = x
                mn = j
        L[ma][mn] += 1
        n = 0
        for j in range(Y):
            n = max(n, B[j] + C[L[ma][j]])
        memo[ma] = A[ma] + n


main()

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

-def main(): -    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) -    A += [-1e10] -    B += [-1e10] -    C += [-1e10] -    memo = [A[i] + B[0] + C[0] for i in range(X + 1)] -    L = [[0 for i in range(Y + 1)] for j in range(X + 1)] -    for i in range(K): -        ma = 0 -        for j in range(X): -            if memo[ma] < memo[j]: -                ma = j -        print((memo[ma])) -        mb = 0 -        mn = 0 -        for j in range(Y): -            x = B[j] + C[L[ma][j]] -            if mb < x: -                mb = x -                mn = j -        L[ma][mn] += 1 -        n = 0 -        for j in range(Y): -            n = max(n, B[j] + C[L[ma][j]]) -        memo[ma] = A[ma] + n - - -main() +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): +        if (i + 1) * (j + 1) > K: +            break +        for k in range(Z): +            if (i + 1) * (j + 1) * (k + 1) > K: +                break +            abc.append(A[i] + B[j] + C[k]) +abc.sort(reverse=True) +for i in range(K): +    print((abc[i]))