X, Y, Z, K = gets.chomp.split(" ").map(&:to_i)

cakes = Array.new(3) do
  gets.chomp.split(" ").map(&:to_i)
end

# 愚直
puts cakes[0]
         .product(cakes[1])
         .product(cakes[2])
         .map(&:flatten)
         .map {|ary| ary.inject(&:+)}
         .sort
         .reverse
         .slice(0...K)
