#include <iostream>
#include <algorithm>
#include <string>

#define tran(x) ((char)('0'+x))

using namespace std;
int a[4];

string getMp(int u)
{
  if(u == 0) return " + ";
  if(u == 1) return " - ";
  if(u == 2) return " * ";

  return " / ";
}

int calc(int s, int t, int u)
{
  if(u == 0) return s+t;
  if(u == 1) return s-t;
  if(u == 2) return s*t;

  return s/t;
}

string conv(string str, int p, int v)
{
  return "("+str+getMp(v)+tran(a[p+1])+")";
}

bool func(string str, int s, int p)
{
  if(p == 3){
    if(s == 10){
      cout << str << endl;
      return true;
    }
    return false;
  }

  for(int i = 0; i < 3; i++)
    if(func(conv(str, p, i), calc(s, a[p+1], i), p+1)) return true;
  if(s%a[p+1] == 0 && func(conv(str, p, 3), calc(s, a[p+1], 3), p+1)) return true;

  return false;
}


bool func2()
{
  int s, t;

  for(int i = 0; i < 4; i++)
    for(int j = 0; j < 4; j++){
      if(i == 3 && a[0]%a[1] != 0) continue;
      if(j == 3 && a[2]%a[3] != 0) continue;
      s = calc(a[0], a[1], i);
      t = calc(a[2], a[3], j);
      for(int k = 0; k < 3; k++)
	if(calc(s, t, k) == 10){
	  cout << "((" << a[0] << getMp(i) << a[1] << ")" << getMp(k) << "(" << a[2] << getMp(j) << a[3] << "))" << endl;
	  return true;
	}
      if(t != 0 && s%t == 0 && calc(s, t, 3) == 10){
	cout << "((" << a[0] << getMp(i) << a[1] << ")" << getMp(3) << "(" << a[2] << getMp(j) << a[3] << "))" << endl;
	return true;
      }
    }

  return false;
}

bool func3()
{
  int s, t;

  for(int i = 0; i < 4; i++){
    if(i == 3 && a[1]%a[2] != 0) continue;
    s = calc(a[1], a[2], i);
    for(int j = 0; j < 4; j++){
      if((s != 0 && j == 3 && a[0]%s == 0) || j != 3){
	t = calc(a[0], s, j);
	for(int k = 0; k < 3; k++)
	  if(calc(t, a[3], k) == 10){
	    cout << "((" << a[0] << getMp(j) << "(" << a[1] << getMp(i) << a[2] << "))" << getMp(k) << a[3] << ")" << endl;
	    return true;
	  }
	if(t%a[3] == 0 && calc(t, a[3], 3) == 10){
	    cout << "((" << a[0] << getMp(j) << "(" << a[1] << getMp(i) << a[2] << "))" << getMp(3) << a[3] << ")" << endl;
	  return true;
	}
      }

      if((j == 3 && s%a[3] == 0) || j != 3){
	t = calc(s, a[3], j);
	for(int k = 0; k < 3; k++)
	  if(calc(a[0], t, k) == 10){
	    cout << "(" << a[0] << getMp(j) << "((" << a[1] << getMp(i) << a[2] << ")" << getMp(k) << a[3] << "))" << endl;
	    return true;
	  }
	if(t != 0 && a[0]%t == 0 && calc(a[0], t, 3) == 10){
	    cout << "(" << a[0] << getMp(j) << "((" << a[1] << getMp(i) << a[2] << ")" << getMp(3) << a[3] << "))" << endl;
	  return true;
	}
      }
    }
  }

  return false;
}

int main()
{
  while(1){
    for(int i = 0; i < 4; i++) cin >> a[i];
    if(a[0] == 0) break;
    sort(a, a+4);

    bool f = false;
    do{
      string str = "";
      str += tran(a[0]);
      if(func(str, a[0], 0) || func2() || func3()){
	f = true;
	break;
      }
    } while(next_permutation(a, a+4));

    if(!f) cout << 0 << endl;
  }

  return 0;
}