type op =
  | Plus
  | Minus
  | Id

let print_op = function
    Plus -> print_char '+'
  | Minus -> print_char '-'
  | Id -> ()

(* list_all 2 [true; false];;
 * - : bool list list =
 * [[true; true]; [false; true]; [true; false]; [false; false]] *)
(* olに含まれる要素で作れる長さnのリストすべてを返す *)
let rec list_all : int -> 'a list -> 'a list list  = fun n ol ->
  if n > 0 then
    List.fold_right (fun l ans ->
        List.fold_right
          (fun o xs ->
             (o :: l) :: xs)
          ol ans)
      (list_all (n - 1) ol) []
  else
    [[]]

let calc_op l opss =  
  let rec loop ans =
    (function
      | (x :: xs, o :: os) ->
      (match o with
          Plus -> loop (ans + x) (xs, os)
        | Minus -> loop (ans - x) (xs, os)
        | Id -> loop x (xs, os))
      | _ -> ans)
  in
  loop 0 (l, opss)  

let ic c = int_of_char c - int_of_char '0'

let () =
  let (a, b, c, d) = Scanf.sscanf (input_line stdin) "%c%c%c%c" (fun a b c d -> (ic a, ic b, ic c, ic d)) in
  let ops_lists = list_all 3 [Plus; Minus] in
  let ops_lists' = List.map (fun ops -> Id :: ops) ops_lists in
  let rec solve = function
      [] -> failwith "Not found"
    | ops :: opss ->
      if calc_op [a;b;c;d] ops = 7 then
        ops
      else
        solve opss
  in
  let ans = solve ops_lists' in
  List.iter2 (fun x op ->
      print_op op;
      print_int x) [a;b;c;d] ans;
  print_string "=7";
  print_newline ()
