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 = []

for i in range(x):

    for j in range(y):

        if(i*j>k): break

        for l in range(z):

            if(i*j*l>k): break

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

h.sort(reverse = True)

for i in range(k):

    print((h[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)

h = []

for i in range(x):

    if(i + 1>k) : break

    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

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

h.sort(reverse = True)

for i in range(k):

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

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