#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;
}