#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

const string temp[5] = {"(((AaB)bC)cD)",
			"((Aa(BbC))cD)",
			"((AaB)b(CcD))",
			"(Aa((BbC)cD))",
			"(Aa(Bb(CcD)))"};
string s;
int pos;
int fact();
int term();
int exp();

int fact() {
  int x;
  if(s[pos] == '(') {
    ++pos;
    x = exp();
    ++pos;
  } else if(isdigit(s[pos])) {
    x = s[pos]-'0';
    ++pos;
  }
  return x;
}

int term() {
  int x = fact();
  while(s[pos] == '*') {
    ++pos;
    x *= fact();
  }
  return x;
}

int exp() {
  int x = term();
  while(s[pos] == '+' || s[pos] == '-') {
    char op = s[pos++];
    if(op == '+') {
      x += term();
    } else if(op == '-') {
      x -= term();
    }
  }
  return x;
}

int main() {
  while(1) {
    int a[4];
    for(int i = 0; i < 4; ++i) {
      cin >> a[i];
    }
    if(a[0]|a[1]|a[2]|a[3]) ; else break;
    sort(a,a+4);
    bool flag = true;
    do {
      char conv[128];
      for(int i = 0; i < 4; ++i) {
	conv['A'+i] = a[i]+'0';
      }
      for(int t = 0; flag && t < 27; ++t) {
	for(int i = 0, tmp = t; i < 3; ++i) {
	  char &op = conv['a'+i];
	  switch(tmp%3) {
	  case 0: op = '+'; break;
	  case 1: op = '-'; break;
	  case 2: op = '*'; break;
	  }
	  tmp /= 3;
	}
	for(int k = 0; flag && k < 5; ++k) {
	  pos = 0;
	  s = temp[k];
	  for(int j = 0; j < s.size(); ++j) {
	    if(isalpha(s[j])) s[j] = conv[s[j]];
	  }
	  if(exp() == 10) {
	    cout << s << endl;
	    flag = false;
	  }
	}
      }
    } while(flag && next_permutation(a,a+4));
    if(flag) cout << 0 << endl;
  }
  return 0;
}