import math

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

abc = [list(map(int,input().split())) for a in range(3)]

ab=[]

for a in abc[0]:

    for b in abc[1]:

        ab.append(a+b)

ab.sort()

ab.reverse()

abc[2].sort()

abc[2].reverse()

abc2=[]

for c in range(len(abc[2])):

    for a in range(min([math.ceil(xyzk[3]),len(ab)])):

        abc2.append(abc[2][c]+ab[a])

abc2.sort()

abc2.reverse()

for a in range(xyzk[3]):

    print((abc2[a]))
import math

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

abc = [list(map(int,input().split())) for a in range(3)]

for a in range(3):

    abc[a].sort()

    abc[a].reverse()

abc2=[]

for a in range(len(abc[0])):

    for b in range(len(abc[1])):

        if (a+1)*(b+1)>xyzk[3]:

            break

        for c in range(len(abc[2])):

            if (a+1)*(b+1)*(c+1)>xyzk[3] :

                break

            abc2.append(abc[0][a]+abc[1][b]+abc[2][c])

abc2.sort()

abc2.reverse()

for a in range(xyzk[3]):

    print((abc2[a]))
import math

xyzk = list(map(int, input().split()))
abc = [list(map(int, input().split())) for a in range(3)]
ab = []
for a in abc[0]:
    for b in abc[1]:
        ab.append(a + b)
ab.sort()
ab.reverse()
abc[2].sort()
abc[2].reverse()
abc2 = []
for c in range(len(abc[2])):
    for a in range(min([math.ceil(xyzk[3]), len(ab)])):
        abc2.append(abc[2][c] + ab[a])
abc2.sort()
abc2.reverse()
for a in range(xyzk[3]):
    print((abc2[a]))

import math

xyzk = list(map(int, input().split()))
abc = [list(map(int, input().split())) for a in range(3)]
for a in range(3):
    abc[a].sort()
    abc[a].reverse()
abc2 = []
for a in range(len(abc[0])):
    for b in range(len(abc[1])):
        if (a + 1) * (b + 1) > xyzk[3]:
            break
        for c in range(len(abc[2])):
            if (a + 1) * (b + 1) * (c + 1) > xyzk[3]:
                break
            abc2.append(abc[0][a] + abc[1][b] + abc[2][c])
abc2.sort()
abc2.reverse()
for a in range(xyzk[3]):
    print((abc2[a]))

-ab = [] -for a in abc[0]: -    for b in abc[1]: -        ab.append(a + b) -ab.sort() -ab.reverse() -abc[2].sort() -abc[2].reverse() +for a in range(3): +    abc[a].sort() +    abc[a].reverse() -for c in range(len(abc[2])): -    for a in range(min([math.ceil(xyzk[3]), len(ab)])): -        abc2.append(abc[2][c] + ab[a]) +for a in range(len(abc[0])): +    for b in range(len(abc[1])): +        if (a + 1) * (b + 1) > xyzk[3]: +            break +        for c in range(len(abc[2])): +            if (a + 1) * (b + 1) * (c + 1) > xyzk[3]: +                break +            abc2.append(abc[0][a] + abc[1][b] + abc[2][c])