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 C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <iostream>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <functional>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <tuple>
#include <complex>
#include <cassert>
#include <exception>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<P> vp;
#define rep(i,a,n) for(ll i = (a);i < (n);i++)
#define per(i,a,n) for(ll i = (a);i > (n);i--)
#define lep(i,a,n) for(ll i = (a);i <= (n);i++)
#define pel(i,a,n) for(ll i = (a);i >= (n);i--)
#define clr(a,b) memset((a),(b),sizeof(a))
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define sz size()
#define print(X) cout << (X) << "\n"
static const int INF = 1e+9+7;
static const ll INFL = 1e+18+7;
int n,m,l;
int p;
string s,t;
ll d[200010],dp[300][300];
char field[200][200];
char h[3] = {'+','-','0'};
 
void create(int a,int b,int c){
  string ans = "";
  ans += char(n + '0');
  ans += h[a];
  ans += char(m + '0');
  ans += h[b];
  ans += char(l + '0');
  ans += h[c];
  ans += char(p + '0');
  ans += "=7";
  print(ans);
}
 
int main(){
  cin >> s;
  n = s[0] - '0';
  m = s[1] - '0';
  l = s[2] - '0';
  p = s[3] - '0';
  rep(i,0,2){
    rep(j,0,2){
      rep(k,0,2){
        ll ans = n;
        if(i == 0)ans += m;
        else ans -= m;
        if(j == 0)ans += l;
        else ans -= l;
        if(k == 0)ans += p;
        else ans -= p;
        if(ans == 7){
          cout << ans << endl;
          cout << i << j << k << endl;
          create(i,j,k);
          return 0;
        }
      }
    }
  }
  return 0;
}