let constr x y =
  let ly = Array.length y in
  let z = Array.(init (length x * ly) (fun i -> x.(i / ly) + y.(i mod ly))) in
  Array.sort (fun x y -> y - x) z; z
let () =
  Scanf.scanf "%d %d %d %d" @@ fun x y z k ->
  let a = Array.init x (fun _ -> Scanf.scanf " %d" ((+) 0)) in
  let b = Array.init y (fun _ -> Scanf.scanf " %d" ((+) 0)) in
  let c = Array.init z (fun _ -> Scanf.scanf " %d" ((+) 0)) in
  let ab = constr a b in
  let abc = constr (Array.sub ab 0 (min (x * y) k)) c in
  Array.sub abc 0 k |> Array.iter (Printf.printf "%d\n");