import heapq



X, Y, Z, K = 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)



Q = []

heapq.heappush(Q, (-1*(A[0]+B[0]+C[0]), 0, 0, 0))

registered = set()

registered.add((0, 0, 0))

for t in range(K):

    s, ai, bi, ci = heapq.heappop(Q)

    print((-s))



    if ai+1 < X and (ai+1, bi, ci) not in registered:

        heapq.heappush(Q, (-1*(A[ai+1]+B[bi]+C[ci]), ai+1, bi, ci))

        registered.add((ai+1, bi, ci))

    if bi+1 < Y and (ai, bi+1, ci) not in registered:

        heapq.heappush(Q, (-1*(A[ai]+B[bi+1]+C[ci]), ai, bi+1, ci))

        registered.add((ai, bi+1, ci))

    if ci+1 < Z and (ai, bi, ci+1) not in registered:

        heapq.heappush(Q, (-1*(A[ai]+B[bi]+C[ci+1]), ai, bi, ci+1))

        registered.add((ai, bi, ci+1))

import heapq



X, Y, Z, K = 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)



Q = []

heapq.heappush(Q, (-1*(A[0]+B[0]+C[0]), 0, 0, 0))

registered = set()

registered.add((0, 0, 0))

for _ in range(K):

    s, ai, bi, ci = heapq.heappop(Q)

    print((-s))



    if ai+1 < X and (ai+1, bi, ci) not in registered:

        heapq.heappush(Q, (-1*(A[ai+1]+B[bi]+C[ci]), ai+1, bi, ci))

        registered.add((ai+1, bi, ci))

    if bi+1 < Y and (ai, bi+1, ci) not in registered:

        heapq.heappush(Q, (-1*(A[ai]+B[bi+1]+C[ci]), ai, bi+1, ci))

        registered.add((ai, bi+1, ci))

    if ci+1 < Z and (ai, bi, ci+1) not in registered:

        heapq.heappush(Q, (-1*(A[ai]+B[bi]+C[ci+1]), ai, bi, ci+1))

        registered.add((ai, bi, ci+1))

import heapq

X, Y, Z, K = 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)
Q = []
heapq.heappush(Q, (-1 * (A[0] + B[0] + C[0]), 0, 0, 0))
registered = set()
registered.add((0, 0, 0))
for t in range(K):
    s, ai, bi, ci = heapq.heappop(Q)
    print((-s))
    if ai + 1 < X and (ai + 1, bi, ci) not in registered:
        heapq.heappush(Q, (-1 * (A[ai + 1] + B[bi] + C[ci]), ai + 1, bi, ci))
        registered.add((ai + 1, bi, ci))
    if bi + 1 < Y and (ai, bi + 1, ci) not in registered:
        heapq.heappush(Q, (-1 * (A[ai] + B[bi + 1] + C[ci]), ai, bi + 1, ci))
        registered.add((ai, bi + 1, ci))
    if ci + 1 < Z and (ai, bi, ci + 1) not in registered:
        heapq.heappush(Q, (-1 * (A[ai] + B[bi] + C[ci + 1]), ai, bi, ci + 1))
        registered.add((ai, bi, ci + 1))

import heapq

X, Y, Z, K = 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)
Q = []
heapq.heappush(Q, (-1 * (A[0] + B[0] + C[0]), 0, 0, 0))
registered = set()
registered.add((0, 0, 0))
for _ in range(K):
    s, ai, bi, ci = heapq.heappop(Q)
    print((-s))
    if ai + 1 < X and (ai + 1, bi, ci) not in registered:
        heapq.heappush(Q, (-1 * (A[ai + 1] + B[bi] + C[ci]), ai + 1, bi, ci))
        registered.add((ai + 1, bi, ci))
    if bi + 1 < Y and (ai, bi + 1, ci) not in registered:
        heapq.heappush(Q, (-1 * (A[ai] + B[bi + 1] + C[ci]), ai, bi + 1, ci))
        registered.add((ai, bi + 1, ci))
    if ci + 1 < Z and (ai, bi, ci + 1) not in registered:
        heapq.heappush(Q, (-1 * (A[ai] + B[bi] + C[ci + 1]), ai, bi, ci + 1))
        registered.add((ai, bi, ci + 1))

-for t in range(K): +for _ in range(K):