let safe_hd ls = try List.hd ls with _ -> 0
let aux ls = abs @@ (safe_hd ls) - (safe_hd (List.tl ls))
let solve k x y z aa bb cc =
  let cp v1 v2 = compare v2 v1 in
  let ee = ref [] in
  for i = 0 to x - 1 do
    for j = 0 to y - 1 do
      ee := (List.nth aa i + List.nth bb j)::!ee
    done;
  done;
  ee := List.sort cp !ee;
  let ans = ref [] in
  for i = 0 to (x * y - 1) do
    for j = 0 to (z - 1) do
      ans := (List.nth !ee i + List.nth cc j)::!ans
    done;
  done;
  let ans = List.sort cp !ans in
  for i = 0 to k - 1 do
    Printf.printf "%d\n" (List.nth ans i)
  done

let _ =
  let x, y, z, k = Scanf.scanf "%d %d %d %d\n" (fun x y z k -> x, y, z, k) in
  let aa, bb, cc = ref [], ref [], ref [] in
  for i = 0 to x - 1 do
    Scanf.scanf (if i <> x - 1 then "%d " else "%d\n") (fun a -> aa := a::!aa)
  done;
  for i = 0 to y - 1 do
    Scanf.scanf (if i <> y - 1 then "%d " else "%d\n") (fun b -> bb := b::!bb)
  done;
  for i = 0 to z - 1 do
    Scanf.scanf (if i <> z - 1 then "%d " else "%d\n") (fun c -> cc := c::!cc)
  done;
  solve k x y z !aa !bb !cc
