Problem: Using the given four integers from 1 to 9, we create an expression that gives an answer of 10. When you enter four integers a, b, c, d, write a program that outputs an expression that gives an answer of 10 according to the following conditions. Also, if there are multiple answers, only the first answer found will be output. If there is no answer, output 0.

* Use only addition (+), subtraction (-), and multiplication (*) as operators. Do not use division (/). You can use three operators.
* You must use all four numbers.
* You can freely change the order of the four numbers.
* You can use parentheses. You can use up to 3 sets (6) of parentheses.



Input

Given multiple datasets. The format of each dataset is as follows:


a b c d

Input ends with four 0s. The number of datasets does not exceed 40.

Output

For each dataset, combine the given four integers with the above arithmetic symbols and parentheses to output an expression or 0 with a value of 10 on one line. The expression string must not exceed 1024 characters.

Example

Input

8 7 9 9
4 4 4 4
5 5 7 5
0 0 0 0


Output

((9 * (9 - 7)) - 8)
0
((7 * 5) - (5 * 5))

Solution (in CPP):

Solution:
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
#include <cctype>
#include <numeric>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
typedef pair<int,int> P;

const int add = 1000000;
const int sub = add + 1;
const int mul = sub + 1;

int A[10], p;
const char ope[3] = { '+', '-', '*' };
string s, res;

char i2c(int i) { return '0' + i; }

int expr();
int term();
int fac();

int expr() {
  int val = term();
  while (s[p] == '+' || s[p] == '-') {
    if (s[p] == '+') { ++p; val += term(); }
    else { ++p; val -= term(); }
  }
  return val;
};

int term() {
  int val = fac();
  while (s[p] == '*' || s[p] == '/') {
    if (s[p] == '*') { ++p; val *= fac(); }
    else { ++p; val /= fac(); }
  }
  return val;
}

int fac() {
  int val = 0;
  if (s[p] == '(') {
    ++p;
    val = expr();
    ++p;
  } else {
    while (isdigit(s[p])) { val = val * 10 + s[p++] - '0'; }
  }
  return val;
}

bool solve2(const string& str) {
  int ret;
  // A+A+A+A
  // pt0 012
  {
    s = str, p = 0;
    if (expr() == 10) { res = s; return true; }
  }
  
  // pt1 ((0)1)2
  {
    s = str, p = 0;
    s.insert(5, 1, ')');
    s.insert(3, 1, ')');
    rep(i,2) s.insert(0, 1, '(');
    if ((ret = expr()) == 10) { res = s; return true; }
    // printf("%d : %s\n", ret, s.c_str());
  }
  
  // pt2 (0)2(1)
  {
    s = str, p = 0;
    s += ')';
    s.insert(4, 1, '(');
    s.insert(3, 1, ')');
    s.insert(0, 1, '(');
    if ((ret = expr()) == 10) { res = s; return true; }
    // printf("%d : %s\n", ret, s.c_str());
  }
  
  // pt3 (1(0))2
  {
    s = str, p = 0;
    s.insert(5, 2, ')');
    s.insert(2, 1, '(');
    s.insert(0, 1, '(');
    if ((ret = expr()) == 10) { res = s; return true; }
    // printf("%d : %s\n", ret, s.c_str());
  }

  // pt4 2((0)1)
  {
    s = str, p = 0;
    s += ')';
    s.insert(5, 1, ')');
    s.insert(2, 2, '(');
    if ((ret = expr()) == 10) { res = s; return true; }
    // printf("%d : %s\n", ret, s.c_str());
  }

  // pt5 2(1(0))
  {
    s = str, p = 0;
    rep(i,2) s += ')';
    s.insert(4, 1, '(');
    s.insert(2, 1, '(');
    if ((ret = expr()) == 10) { res = s; return true; }
    // printf("%d : %s\n", ret, s.c_str());
  }
  
  return false;
}

void solve() {
  string t;

  sort(A, A+4);
  do {
    rep(a,3) rep(b,3) rep(c,3) {
      t = "";
      int aa[] = {a, b, c};
      rep(i,3) {
        t += i2c(A[i]);
        t += ope[aa[i]];
      }
      t += i2c(A[3]);
      if (solve2(t)) {
        for (int i = res.size() - 1; i >= 0; --i) {
          if (res[i] == '-' || res[i] == '+' || res[i] == '*') {
            res.insert(i+1, 1, ' ');
            res.insert(i, 1, ' ');
          }
        }
        printf("%s\n", res.c_str());
        return;
      }
    }
  } while (next_permutation(A, A+4));
  puts("0");
}

int main() {
  while (1) {
    rep(i,4) scanf("%d", A+i);
    if (!A[0]) break;
    solve();
  }
  return 0;
}