Problem:
Score : 300 points

Problem Statement

Sitting in a station waiting room, Joisino is gazing at her train ticket.

The ticket is numbered with four digits A, B, C and D in this order, each between 0 and 9 (inclusive).

In the formula A op1 B op2 C op3 D = 7, replace each of the symbols op1, op2 and op3 with + or - so that the formula holds.

The given input guarantees that there is a solution. If there are multiple solutions, any of them will be accepted.

Constraints

0≤A,B,C,D≤9

All input values are integers.

It is guaranteed that there is a solution.

Input

Input is given from Standard Input in the following format:

ABCD

Output

Print the formula you made, including the part =7.

Use the signs + and -.

Do not print a space between a digit and a sign.

Sample Input 1

1222

Sample Output 1

1+2+2+2=7

This is the only valid solution.

Sample Input 2

0290

Sample Output 2

0-2+9+0=7

0 - 2 + 9 - 0 = 7 is also a valid solution.

Sample Input 3

3242

Sample Output 3

3+2+4-2=7

Solution in Rust (1.15.1) (judge verdict: Accepted)

#![allow(unused_imports)]
#![allow(unused_variables)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(deprecated)]

use std::cell::{Cell, Ref, RefCell, RefMut};
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;
use std::usize;

const MOD_10_9_7: u64 = 1_000_000_007;
const INF: i64 = 1_000_000_000_000;
const MIN_INF: i64 = -1_000_000_000_000;

/// FYI: https://github.com/vain0x/scan-bench
#[allow(unused_macros)]
macro_rules! read {
    ([$t:ty] ; $n:expr) =>
        ((0..$n).map(|_| read!([$t])).collect::<Vec<_>>());
    ($($t:ty),+ ; $n:expr) =>
        ((0..$n).map(|_| read!($($t),+)).collect::<Vec<_>>());
    ([$t:ty]) =>
        (rl().split_whitespace().map(|w| w.parse().unwrap()).collect::<Vec<$t>>());
    ($t:ty) =>
        (rl().parse::<$t>().unwrap());
    ($($t:ty),*) => {{
        let buf = rl();
        let mut w = buf.split_whitespace();
        ($(w.next().unwrap().parse::<$t>().unwrap()),*)
    }};
}

fn rl() -> String {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

pub trait CharToNum {
    fn to_i32(&self) -> i32;
    fn to_i64(&self) -> i64;
    fn to_u64(&self) -> u64;
    fn to_usize(&self) -> usize;
}

impl CharToNum for char {
    /// 1, 2, 3, ... の数字の文字型をもとにi32を返す
    fn to_i32(&self) -> i32 {
        *self as i32 - 48
    }

    /// 1, 2, 3, ... の数字の文字型をもとにi64を返す
    fn to_i64(&self) -> i64 {
        *self as i64 - 48
    }

    /// 1, 2, 3, ... の数字の文字型をもとにi64を返す
    fn to_u64(&self) -> u64 {
        *self as u64 - 48
    }

    /// 1, 2, 3, ... の数字の文字型をもとにusizeを返す
    fn to_usize(&self) -> usize {
        *self as usize - 48
    }
}

fn main() {
    let s = read!(String);
    let sc: Vec<char> = s.chars().collect::<Vec<char>>();
    let num = sc.iter().map(|&x| x.to_i32()).collect::<Vec<_>>();

    for i in 0..2usize.pow(3) {
        let mut ops = vec![];
        for j in 0..3 {
            if 1 << j & i != 0 {
                ops.push('+');
            } else {
                ops.push('-');
            }
        }
        let mut s = num[0];
        for k in 0..ops.len() {
            if ops[k] == '+' {
                s += num[k + 1];
            } else {
                s -= num[k + 1];
            }
        }
        if s == 7 {
            println!(
                "{}{}{}{}{}{}{}=7",
                num[0], ops[0], num[1], ops[1], num[2], ops[2], num[3]
            );
            return;
        }
    }
}