let abcd = Array.init 4 @@ fun _ -> Scanf.scanf " %1d" (+) 0
let g = string_of_int
let rec f acc op i =
  if i >= 4 then (if acc = 7 then (Printf.printf "%s=7\n" op; exit 0))
  else
    let x = abcd.(i) in
    f (acc + x) (op ^ "+" ^ g x) (i + 1);
    f (acc - x) (op ^ "-" ^ g x) (i + 1)
let _ = f abcd.(0) (g abcd.(0)) 1