X,Y,Z,K=[int(s) for s in input().split()]

xls=sorted([int(s) for s in input().split()],reverse=True)

yls=sorted([int(s) for s in input().split()],reverse=True)

zls=sorted([int(s) for s in input().split()],reverse=True)

xyls=[]

for x in xls[:K]:

  for y in yls[:K]:

    xyls.append(x+y)

xyls=sorted(xyls,reverse=True)

cake=[]

for xy in xyls[:K]:

  for z in zls[:K]:

    cake.append(xy+z)

cake=sorted(cake,reverse=True)

for i in range(K):

  print((cake[i]))
X,Y,Z,K=[int(s) for s in input().split()]

xls=sorted([int(s) for s in input().split()],reverse=True)

yls=sorted([int(s) for s in input().split()],reverse=True)

zls=sorted([int(s) for s in input().split()],reverse=True)

cake=[]

for a in range(X):

  for b in range(Y):

    ab=(a+1)*(b+1)

    for c in range(Z):

      if ab*(c+1)>K:

        break

      cake.append(xls[a]+yls[b]+zls[c])

    if ab>K:

      break

cake=sorted(cake,reverse=True)

for i in range(K):

  print((cake[i]))
X, Y, Z, K = [int(s) for s in input().split()]
xls = sorted([int(s) for s in input().split()], reverse=True)
yls = sorted([int(s) for s in input().split()], reverse=True)
zls = sorted([int(s) for s in input().split()], reverse=True)
xyls = []
for x in xls[:K]:
    for y in yls[:K]:
        xyls.append(x + y)
xyls = sorted(xyls, reverse=True)
cake = []
for xy in xyls[:K]:
    for z in zls[:K]:
        cake.append(xy + z)
cake = sorted(cake, reverse=True)
for i in range(K):
    print((cake[i]))

X, Y, Z, K = [int(s) for s in input().split()]
xls = sorted([int(s) for s in input().split()], reverse=True)
yls = sorted([int(s) for s in input().split()], reverse=True)
zls = sorted([int(s) for s in input().split()], reverse=True)
cake = []
for a in range(X):
    for b in range(Y):
        ab = (a + 1) * (b + 1)
        for c in range(Z):
            if ab * (c + 1) > K:
                break
            cake.append(xls[a] + yls[b] + zls[c])
        if ab > K:
            break
cake = sorted(cake, reverse=True)
for i in range(K):
    print((cake[i]))

-xyls = [] -for x in xls[:K]: -    for y in yls[:K]: -        xyls.append(x + y) -xyls = sorted(xyls, reverse=True) -for xy in xyls[:K]: -    for z in zls[:K]: -        cake.append(xy + z) +for a in range(X): +    for b in range(Y): +        ab = (a + 1) * (b + 1) +        for c in range(Z): +            if ab * (c + 1) > K: +                break +            cake.append(xls[a] + yls[b] + zls[c]) +        if ab > K: +            break