

def main():

    x,y,z,k = [int(i) for i in input().split()]

    a = [int(i) for i in input().split()]

    b = [int(i) for i in input().split()]

    c = [int(i) for i in input().split()]



    a.sort(reverse=True)

    b.sort(reverse=True)

    c.sort(reverse=True)



    ans = []



    for i in range(x):

        if i > k:

            break

        for j in range(y):

            if i * j > k:

                break

            for m in range(z):

                if i * j * m > k:

                    break

                ans.append(a[i]+b[j]+c[m])



    ans.sort(reverse=True)

    for i in range(k):

        print((ans[i]))





main()




x,y,z,k = [int(i) for i in input().split()]

a = [int(i) for i in input().split()]

b = [int(i) for i in input().split()]

c = [int(i) for i in input().split()]

a.sort(reverse=True)

b.sort(reverse=True)

c.sort(reverse=True)



ans=[]

for i in range(x):

    if i > k:

        break

    for j in range(y):

        if i*j > k:

            break

        for l in range(z):

            if i*j*l > k:

                break

            ans.append(a[i]+b[j]+c[l])



ans.sort(reverse=True)



for i in range(k):

    print((ans[i]))
def main():
    x, y, z, k = [int(i) for i in input().split()]
    a = [int(i) for i in input().split()]
    b = [int(i) for i in input().split()]
    c = [int(i) for i in input().split()]
    a.sort(reverse=True)
    b.sort(reverse=True)
    c.sort(reverse=True)
    ans = []
    for i in range(x):
        if i > k:
            break
        for j in range(y):
            if i * j > k:
                break
            for m in range(z):
                if i * j * m > k:
                    break
                ans.append(a[i] + b[j] + c[m])
    ans.sort(reverse=True)
    for i in range(k):
        print((ans[i]))


main()

x, y, z, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)
ans = []
for i in range(x):
    if i > k:
        break
    for j in range(y):
        if i * j > k:
            break
        for l in range(z):
            if i * j * l > k:
                break
            ans.append(a[i] + b[j] + c[l])
ans.sort(reverse=True)
for i in range(k):
    print((ans[i]))

-def main(): -    x, y, z, k = [int(i) for i in input().split()] -    a = [int(i) for i in input().split()] -    b = [int(i) for i in input().split()] -    c = [int(i) for i in input().split()] -    a.sort(reverse=True) -    b.sort(reverse=True) -    c.sort(reverse=True) -    ans = [] -    for i in range(x): -        if i > k: +x, y, z, k = [int(i) for i in input().split()] +a = [int(i) for i in input().split()] +b = [int(i) for i in input().split()] +c = [int(i) for i in input().split()] +a.sort(reverse=True) +b.sort(reverse=True) +c.sort(reverse=True) +ans = [] +for i in range(x): +    if i > k: +        break +    for j in range(y): +        if i * j > k: -        for j in range(y): -            if i * j > k: +        for l in range(z): +            if i * j * l > k: -            for m in range(z): -                if i * j * m > k: -                    break -                ans.append(a[i] + b[j] + c[m]) -    ans.sort(reverse=True) -    for i in range(k): -        print((ans[i])) - - -main() +            ans.append(a[i] + b[j] + c[l]) +ans.sort(reverse=True) +for i in range(k): +    print((ans[i]))