x,y,z,k = list(map(int,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)

ab = []

for i in range(x):

  for j in range(y):

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

ab.sort(reverse=True)

ab = ab[0:k]

abc = []

for i in ab:

  for j in c:

    abc.append(i+j)

abc.sort(reverse=True)

abc = abc[0:k]

for i in abc:

  print(i)
x,y,z,k = list(map(int,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)

abc = []



for i in range(x):

  

  for j in range(y):

   

    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)

abc = abc[0:k]

for i in abc:

  print(i)

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

x, y, z, k = list(map(int, 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)
abc = []
for i in range(x):
    for j in range(y):
        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)
abc = abc[0:k]
for i in abc:
    print(i)

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