# util functions

# debug
$debugFlag = ( ARGV[0] != nil )
p "==== DEBUG MODE ====" if $debugFlag

def pd(str)
  p str if $debugFlag
end

# input
inputs = []
lc = 0
while l = $stdin.gets do
  if false
    inputs << l.chomp.split(" ").map(&:to_s)
  else
    inputs << l.chomp.split(" ").map(&:to_i)
  end
  lc += 1
end

# input check
if $debugFlag
  p "--- INPUT (begin) ---"
  inputs.each do |l_i|
    p l_i
  end
  p "--- INPUT (end) ---"
  print "\n"
end

kk = inputs[0][-1]
as = inputs[1].sort!
bs = inputs[2].sort!
cs = inputs[3].sort!

# body
if $debugFlag
  p kk
  p as
  p bs
  p cs
end

$hh = {}
ans = []
queue = [[as,bs,cs,0,0,0,0]]
while kk > 0
  idx = 0
  cur = 10**10
  queue.size.times do |i|
    if queue[i][-1] < cur
      cur = queue[i][-1]
      idx = i
    end
  end
  cur_as, cur_bs, cur_cs, aidx, bidx, cidx, delta = queue.delete_at(idx)
  queue << [cur_as[0..-2], cur_bs, cur_cs, aidx+1,bidx,cidx,delta+cur_as[-1]-cur_as[-2]] if cur_as.size >= 2
  queue << [cur_as, cur_bs[0..-2], cur_cs, aidx,bidx+1,cidx,delta+cur_bs[-1]-cur_bs[-2]] if cur_bs.size >= 2
  queue << [cur_as, cur_bs, cur_cs[0..-2], aidx,bidx,cidx+1,delta+cur_cs[-1]-cur_cs[-2]] if cur_cs.size >= 2
  
  if $hh[[aidx, bidx, cidx]] == nil
    ans << (cur_as[-1] + cur_bs[-1] + cur_cs[-1])
    kk -= 1
    $hh[[aidx, bidx, cidx]] = 1
    if $debugFlag
      print "add #{aidx},#{bidx},#{cidx}:"
      p (cur_as[-1] + cur_bs[-1] + cur_cs[-1])
    end
  end
end

puts ans.sort.reverse
