# input = sys.stdin.readline

from bisect import *

from collections import *

from heapq import *



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)



lst=[]

for a in A:

    for b in B:

        lst.append(a+b)

lst.sort(reverse=True)

lst=lst[:K]



_lst=[]

for a in lst:

    for c in C:

        _lst.append(a+c)



_lst.sort(reverse=True)

for i in range(K):

    print((_lst[i]))

from bisect import *

from collections import *

from fractions import gcd

from math import factorial

from itertools import *

from heapq import *

import copy



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)

dic={A[0]+B[0]+C[0]:["0_0_0"]}

usedlst=set(["0_0_0"])

lst=[]

D=[-(A[0]+B[0]+C[0])]

heapify(D)



def strmode(a,b,c):

    return(str(a)+"_"+str(b)+"_"+str(c),A[a]+B[b]+C[c])

while len(lst)<K:



    value=heappop(D)

    lst.append(-value)

    a,b,c=list(map(int,dic[-value].pop().split("_")))

    for x,y,z in ([[a+1,b,c],[a,b+1,c],[a,b,c+1]]):



        if x<X and y<Y and z<Z:

            name,value=strmode(x,y,z)

            if not name in usedlst:

                usedlst.add(name)

                heappush(D,-value)

                if not value in dic:

                    dic.update({value:[name]})

                else:

                    dic[value].append(name)

for i in lst:

    print(i)

# input = sys.stdin.readline
from bisect import *
from collections import *
from heapq import *

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)
lst = []
for a in A:
    for b in B:
        lst.append(a + b)
lst.sort(reverse=True)
lst = lst[:K]
_lst = []
for a in lst:
    for c in C:
        _lst.append(a + c)
_lst.sort(reverse=True)
for i in range(K):
    print((_lst[i]))

from bisect import *
from collections import *
from fractions import gcd
from math import factorial
from itertools import *
from heapq import *
import copy

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)
dic = {A[0] + B[0] + C[0]: ["0_0_0"]}
usedlst = set(["0_0_0"])
lst = []
D = [-(A[0] + B[0] + C[0])]
heapify(D)


def strmode(a, b, c):
    return (str(a) + "_" + str(b) + "_" + str(c), A[a] + B[b] + C[c])


while len(lst) < K:
    value = heappop(D)
    lst.append(-value)
    a, b, c = list(map(int, dic[-value].pop().split("_")))
    for x, y, z in [[a + 1, b, c], [a, b + 1, c], [a, b, c + 1]]:
        if x < X and y < Y and z < Z:
            name, value = strmode(x, y, z)
            if not name in usedlst:
                usedlst.add(name)
                heappush(D, -value)
                if not value in dic:
                    dic.update({value: [name]})
                else:
                    dic[value].append(name)
for i in lst:
    print(i)

-# input = sys.stdin.readline +from fractions import gcd +from math import factorial +from itertools import * +import copy +dic = {A[0] + B[0] + C[0]: ["0_0_0"]} +usedlst = set(["0_0_0"]) -for a in A: -    for b in B: -        lst.append(a + b) -lst.sort(reverse=True) -lst = lst[:K] -_lst = [] -for a in lst: -    for c in C: -        _lst.append(a + c) -_lst.sort(reverse=True) -for i in range(K): -    print((_lst[i])) +D = [-(A[0] + B[0] + C[0])] +heapify(D) + + +def strmode(a, b, c): +    return (str(a) + "_" + str(b) + "_" + str(c), A[a] + B[b] + C[c]) + + +while len(lst) < K: +    value = heappop(D) +    lst.append(-value) +    a, b, c = list(map(int, dic[-value].pop().split("_"))) +    for x, y, z in [[a + 1, b, c], [a, b + 1, c], [a, b, c + 1]]: +        if x < X and y < Y and z < Z: +            name, value = strmode(x, y, z) +            if not name in usedlst: +                usedlst.add(name) +                heappush(D, -value) +                if not value in dic: +                    dic.update({value: [name]}) +                else: +                    dic[value].append(name) +for i in lst: +    print(i)