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

a.reverse()

b.sort()

b.reverse()

c.sort()

c.reverse()



a2=a[:k]

b2=[]

for i in a2:

  for j in b[:k]:

    b2.append(i+j)

  b2.sort()

  b2.reverse()

  b2=b2[:k]



c2=[]

for i in b2:

  for j in c[:k]:

    c2.append(i+j)

  c2.sort()

  c2.reverse()

  c2=c2[:k]

for i in c2:

  print(i)
xx, yy, zz, 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=1)

b.sort(reverse=1)

c.sort(reverse=1)

ans = []



for x in range(min(xx, k)):

    for y in range(min(yy, k // (x + 1))):

        for z in range(min(zz, k // ((x + 1) * (y + 1)))):

            ans.append(a[x] + b[y] + c[z])

ans.sort(reverse=1)



for i in range(k):

    print((ans[i]))

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()
a.reverse()
b.sort()
b.reverse()
c.sort()
c.reverse()
a2 = a[:k]
b2 = []
for i in a2:
    for j in b[:k]:
        b2.append(i + j)
    b2.sort()
    b2.reverse()
    b2 = b2[:k]
c2 = []
for i in b2:
    for j in c[:k]:
        c2.append(i + j)
    c2.sort()
    c2.reverse()
    c2 = c2[:k]
for i in c2:
    print(i)

xx, yy, zz, 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=1)
b.sort(reverse=1)
c.sort(reverse=1)
ans = []
for x in range(min(xx, k)):
    for y in range(min(yy, k // (x + 1))):
        for z in range(min(zz, k // ((x + 1) * (y + 1)))):
            ans.append(a[x] + b[y] + c[z])
ans.sort(reverse=1)
for i in range(k):
    print((ans[i]))

-x, y, z, k = [int(i) for i in input().split()] +xx, yy, zz, k = [int(i) for i in input().split()] -a.sort() -a.reverse() -b.sort() -b.reverse() -c.sort() -c.reverse() -a2 = a[:k] -b2 = [] -for i in a2: -    for j in b[:k]: -        b2.append(i + j) -    b2.sort() -    b2.reverse() -    b2 = b2[:k] -c2 = [] -for i in b2: -    for j in c[:k]: -        c2.append(i + j) -    c2.sort() -    c2.reverse() -    c2 = c2[:k] -for i in c2: -    print(i) +a.sort(reverse=1) +b.sort(reverse=1) +c.sort(reverse=1) +ans = [] +for x in range(min(xx, k)): +    for y in range(min(yy, k // (x + 1))): +        for z in range(min(zz, k // ((x + 1) * (y + 1)))): +            ans.append(a[x] + b[y] + c[z]) +ans.sort(reverse=1) +for i in range(k): +    print((ans[i]))