#conding utf-8

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

ans=[]

for i in range(len(a)):

  for j in range(len(b)):

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

    

ab.sort()

ab.reverse()

del ab[k:]



c.sort()

c.reverse()



for i in range(len(ab)):

  for j in range(len(c)):

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

    

ans.sort()

ans.reverse()



for i in range(k):

  print((ans[i]))
#conding utf-8

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

b.sort()

c.sort()

a.reverse()

b.reverse()

c.reverse()



ans=[]



for i in range(len(a)):

  for j in range(len(b)):

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

      break

    for k in range(len(c)):

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

        break

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

    

ans.sort()

ans.reverse()



for i in range(K):

  print((ans[i]))
# conding utf-8
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 = []
ans = []
for i in range(len(a)):
    for j in range(len(b)):
        ab.append(a[i] + b[j])
ab.sort()
ab.reverse()
del ab[k:]
c.sort()
c.reverse()
for i in range(len(ab)):
    for j in range(len(c)):
        ans.append(ab[i] + c[j])
ans.sort()
ans.reverse()
for i in range(k):
    print((ans[i]))

# conding utf-8
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()
b.sort()
c.sort()
a.reverse()
b.reverse()
c.reverse()
ans = []
for i in range(len(a)):
    for j in range(len(b)):
        if (i + 1) * (j + 1) > K:
            break
        for k in range(len(c)):
            if (i + 1) * (j + 1) * (k + 1) > K:
                break
            ans.append(a[i] + b[j] + c[k])
ans.sort()
ans.reverse()
for i in range(K):
    print((ans[i]))

-x, y, z, k = list(map(int, input().split())) +x, y, z, K = list(map(int, input().split())) -ab = [] +a.sort() +b.sort() +c.sort() +a.reverse() +b.reverse() +c.reverse() -        ab.append(a[i] + b[j]) -ab.sort() -ab.reverse() -del ab[k:] -c.sort() -c.reverse() -for i in range(len(ab)): -    for j in range(len(c)): -        ans.append(ab[i] + c[j]) +        if (i + 1) * (j + 1) > K: +            break +        for k in range(len(c)): +            if (i + 1) * (j + 1) * (k + 1) > K: +                break +            ans.append(a[i] + b[j] + c[k]) -for i in range(k): +for i in range(K):