

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, Bで総当たり、上位K個をスタック

tmp = [a+b for a in A for b in B]

tmp.sort(reverse=True)

tmp = tmp[:K]



# 残りのc個に対しても総当たり

ans = [t+c for t in tmp for c in C]

ans.sort(reverse=True)

ans = ans[:K]

for s in ans:

    print(s)



def conKey(i, j, k):

    return str(i)+'-'+str(j)+'-'+str(k)





def getKey(s):

    return list(map(int, s.split('-')))





import heapq

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)



h = []

stack = set([])

ans = []

i, j, k = 0, 0, 0

heapq.heappush(h, (-(A[i]+B[j]+C[k]), conKey(i, j, k)))

stack.add(conKey(i, j, k))

for _ in range(K):

    tmp, key = heapq.heappop(h)

    print((-tmp))

    i, j, k = getKey(key)

    key_0 = [i, j, k]



    for m in range(3):

        key_tmp = key_0.copy()

        if key_tmp[m] >= (X, Y, Z)[m] - 1:

            continue

        key_tmp[m] += 1

        tmp_sum = A[key_tmp[0]] + B[key_tmp[1]] + C[key_tmp[2]]



        str_key = conKey(*key_tmp)



        if str_key not in stack:

            heapq.heappush(h, (-tmp_sum, str_key))

            stack.add(str_key)
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, Bで総当たり、上位K個をスタック
tmp = [a + b for a in A for b in B]
tmp.sort(reverse=True)
tmp = tmp[:K]
# 残りのc個に対しても総当たり
ans = [t + c for t in tmp for c in C]
ans.sort(reverse=True)
ans = ans[:K]
for s in ans:
    print(s)

def conKey(i, j, k):
    return str(i) + "-" + str(j) + "-" + str(k)


def getKey(s):
    return list(map(int, s.split("-")))


import heapq

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)
h = []
stack = set([])
ans = []
i, j, k = 0, 0, 0
heapq.heappush(h, (-(A[i] + B[j] + C[k]), conKey(i, j, k)))
stack.add(conKey(i, j, k))
for _ in range(K):
    tmp, key = heapq.heappop(h)
    print((-tmp))
    i, j, k = getKey(key)
    key_0 = [i, j, k]
    for m in range(3):
        key_tmp = key_0.copy()
        if key_tmp[m] >= (X, Y, Z)[m] - 1:
            continue
        key_tmp[m] += 1
        tmp_sum = A[key_tmp[0]] + B[key_tmp[1]] + C[key_tmp[2]]
        str_key = conKey(*key_tmp)
        if str_key not in stack:
            heapq.heappush(h, (-tmp_sum, str_key))
            stack.add(str_key)

+def conKey(i, j, k): +    return str(i) + "-" + str(j) + "-" + str(k) + + +def getKey(s): +    return list(map(int, s.split("-"))) + + +import heapq + -# まずA, Bで総当たり、上位K個をスタック -tmp = [a + b for a in A for b in B] -tmp.sort(reverse=True) -tmp = tmp[:K] -# 残りのc個に対しても総当たり -ans = [t + c for t in tmp for c in C] -ans.sort(reverse=True) -ans = ans[:K] -for s in ans: -    print(s) +h = [] +stack = set([]) +ans = [] +i, j, k = 0, 0, 0 +heapq.heappush(h, (-(A[i] + B[j] + C[k]), conKey(i, j, k))) +stack.add(conKey(i, j, k)) +for _ in range(K): +    tmp, key = heapq.heappop(h) +    print((-tmp)) +    i, j, k = getKey(key) +    key_0 = [i, j, k] +    for m in range(3): +        key_tmp = key_0.copy() +        if key_tmp[m] >= (X, Y, Z)[m] - 1: +            continue +        key_tmp[m] += 1 +        tmp_sum = A[key_tmp[0]] + B[key_tmp[1]] + C[key_tmp[2]] +        str_key = conKey(*key_tmp) +        if str_key not in stack: +            heapq.heappush(h, (-tmp_sum, str_key)) +            stack.add(str_key)