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()))



ab = []

for i in range(x):

    for j in range(y):

        ab.append(a[i] + b[j])

ab.sort(reverse = True)



abc = []

for i in range(min(k,len(ab))):

    for j in range(z):

        abc.append(ab[i] + c[j])



abc.sort(reverse = True)



for i in range(k):

    print((abc[i]))
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)



abc = []



for i in range(x):

    for j in range(y):

        if (i + 1) * (j + 1) > k:

            break

        for l in range(z):

            if (i + 1) * (j + 1) * (l + 1 ) > k:

                break

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



abc.sort(reverse = True)



for i in range(k):

    print((abc[i]))

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()))
ab = []
for i in range(x):
    for j in range(y):
        ab.append(a[i] + b[j])
ab.sort(reverse=True)
abc = []
for i in range(min(k, len(ab))):
    for j in range(z):
        abc.append(ab[i] + c[j])
abc.sort(reverse=True)
for i in range(k):
    print((abc[i]))

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)
abc = []
for i in range(x):
    for j in range(y):
        if (i + 1) * (j + 1) > k:
            break
        for l in range(z):
            if (i + 1) * (j + 1) * (l + 1) > k:
                break
            abc.append(a[i] + b[j] + c[l])
abc.sort(reverse=True)
for i in range(k):
    print((abc[i]))

-ab = [] +a.sort(reverse=True) +b.sort(reverse=True) +c.sort(reverse=True) +abc = [] -        ab.append(a[i] + b[j]) -ab.sort(reverse=True) -abc = [] -for i in range(min(k, len(ab))): -    for j in range(z): -        abc.append(ab[i] + c[j]) +        if (i + 1) * (j + 1) > k: +            break +        for l in range(z): +            if (i + 1) * (j + 1) * (l + 1) > k: +                break +            abc.append(a[i] + b[j] + c[l])