let () = Scanf.scanf "%d %d %d %d\n" @@ fun x y z k ->
  let as_ = Array.init x @@ fun _ -> Scanf.scanf "%d " @@ fun a -> a in
  let bs = Array.init y @@ fun _ -> Scanf.scanf "%d " @@ fun b -> b in
  let cs = Array.init z @@ fun _ -> Scanf.scanf "%d " @@ fun c -> c in
  let abs = Array.init (x * y) @@ fun i -> as_.(i mod x) + bs.(i / x) in
  Array.sort (fun ab ab' -> compare ab' ab) abs;
  let abcs = Array.init (min k (x * y) * z) @@ fun i -> abs.(i / z) + cs.(i mod z) in
  Array.sort (fun abc abc' -> compare abc' abc) abcs;
  for i = 0 to k - 1 do
    Printf.printf "%d\n" abcs.(i)
  done

