# coding: utf-8

import sys

from bisect import bisect_left, bisect_right

import itertools

from heapq import heapify, heappop, heappush



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



# AとBは全探索、その後二分探索

X, Y, Z, K = lr()

A = lr(); A.sort()

B = lr(); B.sort()

C = lr(); C.sort()

D = []

for a, b in itertools.product(A, B):

    D.append(a+b)

D.sort()

if len(D) > K:

    D = D[-K:]



def check(x):

    length = len(D)

    count = 0

    for y in C:

        i = bisect_left(D, x-y)

        count += length - i

    return count >= K



ok = 0; ng = 10 ** 11

while abs(ng-ok) > 1:

    mid = (ok+ng) // 2

    if check(mid):

        ok = mid

    else:

        ng = mid



# ok以上の値

answer = []

for y in C:

    index = bisect_left(D, ok-y)

    for i in range(index, len(D)):

        heappush(answer, -(D[i]+y))



for i in range(K):

    print((-heappop(answer)))



# 02
# coding: utf-8

import sys

from heapq import heapify, heappop, heappush



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



# 虫の目、一個ずつheapへ

X, Y, Z, K = lr()

A = lr(); A.sort(reverse=True)

B = lr(); B.sort(reverse=True)

C = lr(); C.sort(reverse=True)



ma = A[0] + B[0] + C[0]

heap = [(-ma, (0, 0, 0))]

used = set()

for _ in range(K):

    result, place = heappop(heap)

    print((-result))

    i, j, k = place

    p = (i+1, j, k)

    if i + 1 < len(A) and p not in used:

        val = A[i+1] + B[j] + C[k]

        used.add(p)

        heappush(heap, (-val, p))

    p = (i, j+1, k)

    if j + 1 < len(B) and p not in used:

        val = A[i] + B[j+1] + C[k]

        used.add(p)

        heappush(heap, (-val, p))

    p = (i, j, k+1)

    if k + 1 < len(C) and p not in used:

        val = A[i] + B[j] + C[k+1]

        used.add(p)

        heappush(heap, (-val, p))



# 26

# coding: utf-8
import sys
from bisect import bisect_left, bisect_right
import itertools
from heapq import heapify, heappop, heappush

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
# AとBは全探索、その後二分探索
X, Y, Z, K = lr()
A = lr()
A.sort()
B = lr()
B.sort()
C = lr()
C.sort()
D = []
for a, b in itertools.product(A, B):
    D.append(a + b)
D.sort()
if len(D) > K:
    D = D[-K:]


def check(x):
    length = len(D)
    count = 0
    for y in C:
        i = bisect_left(D, x - y)
        count += length - i
    return count >= K


ok = 0
ng = 10**11
while abs(ng - ok) > 1:
    mid = (ok + ng) // 2
    if check(mid):
        ok = mid
    else:
        ng = mid
# ok以上の値
answer = []
for y in C:
    index = bisect_left(D, ok - y)
    for i in range(index, len(D)):
        heappush(answer, -(D[i] + y))
for i in range(K):
    print((-heappop(answer)))
# 02

# coding: utf-8
import sys
from heapq import heapify, heappop, heappush

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
# 虫の目、一個ずつheapへ
X, Y, Z, K = lr()
A = lr()
A.sort(reverse=True)
B = lr()
B.sort(reverse=True)
C = lr()
C.sort(reverse=True)
ma = A[0] + B[0] + C[0]
heap = [(-ma, (0, 0, 0))]
used = set()
for _ in range(K):
    result, place = heappop(heap)
    print((-result))
    i, j, k = place
    p = (i + 1, j, k)
    if i + 1 < len(A) and p not in used:
        val = A[i + 1] + B[j] + C[k]
        used.add(p)
        heappush(heap, (-val, p))
    p = (i, j + 1, k)
    if j + 1 < len(B) and p not in used:
        val = A[i] + B[j + 1] + C[k]
        used.add(p)
        heappush(heap, (-val, p))
    p = (i, j, k + 1)
    if k + 1 < len(C) and p not in used:
        val = A[i] + B[j] + C[k + 1]
        used.add(p)
        heappush(heap, (-val, p))
# 26

-from bisect import bisect_left, bisect_right -import itertools -# AとBは全探索、その後二分探索 +# 虫の目、一個ずつheapへ -A.sort() +A.sort(reverse=True) -B.sort() +B.sort(reverse=True) -C.sort() -D = [] -for a, b in itertools.product(A, B): -    D.append(a + b) -D.sort() -if len(D) > K: -    D = D[-K:] - - -def check(x): -    length = len(D) -    count = 0 -    for y in C: -        i = bisect_left(D, x - y) -        count += length - i -    return count >= K - - -ok = 0 -ng = 10**11 -while abs(ng - ok) > 1: -    mid = (ok + ng) // 2 -    if check(mid): -        ok = mid -    else: -        ng = mid -# ok以上の値 -answer = [] -for y in C: -    index = bisect_left(D, ok - y) -    for i in range(index, len(D)): -        heappush(answer, -(D[i] + y)) -for i in range(K): -    print((-heappop(answer))) -# 02 +C.sort(reverse=True) +ma = A[0] + B[0] + C[0] +heap = [(-ma, (0, 0, 0))] +used = set() +for _ in range(K): +    result, place = heappop(heap) +    print((-result)) +    i, j, k = place +    p = (i + 1, j, k) +    if i + 1 < len(A) and p not in used: +        val = A[i + 1] + B[j] + C[k] +        used.add(p) +        heappush(heap, (-val, p)) +    p = (i, j + 1, k) +    if j + 1 < len(B) and p not in used: +        val = A[i] + B[j + 1] + C[k] +        used.add(p) +        heappush(heap, (-val, p)) +    p = (i, j, k + 1) +    if k + 1 < len(C) and p not in used: +        val = A[i] + B[j] + C[k + 1] +        used.add(p) +        heappush(heap, (-val, p)) +# 26