x,y,z,k = gets.chomp.split(" ")
as = gets.chomp!.split(" ")
bs = gets.chomp!.split(" ")
cs = gets.chomp!.split(" ")
cakes = [as.map!{|x| x.to_i}.sort.reverse!, bs.map!{|x| x.to_i}.sort.reverse!, cs.map!{|x| x.to_i}.sort.reverse!]
k = k.to_i

oishii = {[0,0,0]=>cakes[0][0]+cakes[1][0]+cakes[2][0]}
puts oishii
k.times do |i|
  maax = oishii.sort_by{|a,b| b}.reverse!
  e,f,g = maax[0][0]
  puts oishii.delete(maax[0][0])
  unless oishii.has_key?([e+1, f, g])
    oishii[[e+1,f,g]] = cakes[0][e+1].to_i+cakes[1][f].to_i+cakes[2][g].to_i
  end
  unless oishii.has_key?([e, f+1, g])
    oishii[[e,f+1,g]] = cakes[0][e].to_i+cakes[1][f+1].to_i+cakes[2][g].to_i
  end
  unless oishii.has_key?([e, f, g+1])
    oishii[[e,f,g+1]] = cakes[0][e].to_i+cakes[1][f].to_i+cakes[2][g+1].to_i
  end
end