#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define opinit() rep(i,9){if(i<3)op[i]='+';else if(i<6)op[i]='-';else op[i]='*';}
#define a n[0]
#define b n[1]
#define c n[2]
#define d n[3]
#define op1 op[0]
#define op2 op[1]
#define op3 op[2]

/*±±©ç*/
template < class BidirectionalIterator >
bool next_combination ( BidirectionalIterator first1 ,
  BidirectionalIterator last1 ,
  BidirectionalIterator first2 ,
  BidirectionalIterator last2 )
{
  if (( first1 == last1 ) || ( first2 == last2 )) {
    return false ;
  }
  BidirectionalIterator m1 = last1 ;
  BidirectionalIterator m2 = last2 ; --m2;
  while (--m1 != first1 && !(* m1 < *m2 )){
  }
  bool result = (m1 == first1 ) && !(* first1 < *m2 );
  if (! result ) {
    // @
    while ( first2 != m2 && !(* m1 < * first2 )) {
      ++ first2 ;
    }
    first1 = m1;
    std :: iter_swap (first1 , first2 );
    ++ first1 ;
    ++ first2 ;
  }
  if (( first1 != last1 ) && ( first2 != last2 )) {
    // A
    m1 = last1 ; m2 = first2 ;
    while (( m1 != first1 ) && (m2 != last2 )) {
      std :: iter_swap (--m1 , m2 );
      ++ m2;
    }
    // B
    std :: reverse (first1 , m1 );
    std :: reverse (first1 , last1 );
    std :: reverse (m2 , last2 );
    std :: reverse (first2 , last2 );
  }
  return ! result ;
}
 
template < class BidirectionalIterator >
bool next_combination ( BidirectionalIterator first ,
  BidirectionalIterator middle ,
  BidirectionalIterator last )
{
  return next_combination (first , middle , middle , last );
}
/*±±ÜÅRsy*/

int ans(int x,int y,char op){
	switch(op){
	case '+':
		return x+y;
	case '-':
		return x-y;
	case '*':
		return x*y;
	}
	
}

int main(){
	vector<int>n(4);
	vector<char>op(9);
	opinit();
	
	int A,B;
	
	while(cin >> a >> b >> c >> d && a || b || c || d){
		sort(n.begin(),n.end());
		bool flag = false;
		do{
			//sort(op.begin(),op	.end());
			do{
				/*1p^[*/
				A = ans(a,b,op1);
				B = ans(A,c,op2);
				if( ans(B,d,op3) == 10){
					printf("((%d %c %d) %c %d) %c %d\n",a,op1,b,op2,c,op3,d);
					flag = true;
					goto end;
				}
				/*2p^[*/
				A = ans(b,c,op2);
				B = ans(a,A,op1);
				if( ans(B,d,op3) == 10){
					printf("(%d %c (%d %c %d)) %c %d\n",a,op1,b,op2,c,op3,d);
					flag = true;
					goto end;
				}
				/*3p^[*/
				A = ans(c,d,op3);
				B = ans(b,A,op2);
				if( ans(a,B,op1) == 10){
					printf("%d %c (%d %c (%d %c %d))\n",a,op1,b,op2,c,op3,d);
					flag = true;
					goto end;
				}
				/*4p^[*/
				A = ans(a,b,op1);
				B = ans(c,d,op3);
				if( ans(A,B,op2) == 10){
					printf("(%d %c %d) %c (%d %c %d)\n",a,op1,b,op2,c,op3,d);
					flag = true;
					goto end;
				}
				/*5p^[*/
				A = ans(b,c,op2);
				B = ans(A,d,op3);
				if( ans(a,B,op1) == 10){
					printf("%d %c ((%d %c %d) %c %d)\n",a,op1,b,op2,c,op3,d);
					flag = true;
					goto end;
				}
			}while(next_permutation(op.begin(),op.end()));
		}while(next_permutation(n.begin(),n.end()));
		end:
		if(!flag)cout << "0" << endl;
	}
}
	