x, y, z, k = map(int, input().split())

A = list(map(int, input().split()))

B = list(map(int, input().split()))

C = list(map(int, input().split()))

L = []

for i in A:

  for j in B:

    L.append(i+j)

S = sorted(L, reverse=True)[:k]

T = []

for i in S:

  for j in sorted(C, reverse=True)[:k]:

    T.append(i+j)

print(*sorted(T, reverse=True)[:k], sep="\n")

x, y, z, k = map(int, input().split())

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

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

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

L = []

for i in range(min(x, k)):

  for j in range(min(y, k//(i+1))):

    for l in range(min(z, k//(i+1)//(j+1))):

      L.append(A[i]+B[j]+C[l])

print(*sorted(L)[::-1][:k], sep="\n")

x, y, z, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
L = []
for i in A:
    for j in B:
        L.append(i + j)
S = sorted(L, reverse=True)[:k]
T = []
for i in S:
    for j in sorted(C, reverse=True)[:k]:
        T.append(i + j)
print(*sorted(T, reverse=True)[:k], sep="\n")

x, y, z, k = map(int, input().split())
A = sorted(list(map(int, input().split())), reverse=True)
B = sorted(list(map(int, input().split())), reverse=True)
C = sorted(list(map(int, input().split())), reverse=True)
L = []
for i in range(min(x, k)):
    for j in range(min(y, k // (i + 1))):
        for l in range(min(z, k // (i + 1) // (j + 1))):
            L.append(A[i] + B[j] + C[l])
print(*sorted(L)[::-1][:k], sep="\n")

-A = list(map(int, input().split())) -B = list(map(int, input().split())) -C = list(map(int, input().split())) +A = sorted(list(map(int, input().split())), reverse=True) +B = sorted(list(map(int, input().split())), reverse=True) +C = sorted(list(map(int, input().split())), reverse=True) -for i in A: -    for j in B: -        L.append(i + j) -S = sorted(L, reverse=True)[:k] -T = [] -for i in S: -    for j in sorted(C, reverse=True)[:k]: -        T.append(i + j) -print(*sorted(T, reverse=True)[:k], sep="\n") +for i in range(min(x, k)): +    for j in range(min(y, k // (i + 1))): +        for l in range(min(z, k // (i + 1) // (j + 1))): +            L.append(A[i] + B[j] + C[l]) +print(*sorted(L)[::-1][:k], sep="\n")