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

int calc(int a,int b,char c){
  switch(c){
  case'+':
    return a+b;
  case'-':
    return a-b;
  case'*':
    return a*b;
  }
}


int main(){
  int n[4];
  char s[3] = {'+','-','*'};
	int ans = 0;
	bool findans;
  while(true){
    cin>>n[0]>>n[1]>>n[2]>>n[3];
		if(n[0]==0)break;
    sort(n,n+4);
		findans = false;
    do{
      for(int j=0;j<27;j++){
				ans = calc(calc(calc(n[0],n[1],s[j/9]),n[2],s[j/3%3]),n[3],s[j%3]);
				if (ans == 10){
					cout << "((" << n[0] << s[j/9] << n[1] << ")" << s[j/3%3] << n[2] << ")" << s[j%3] << n[3] << endl;
					findans = true;
					break;
				}
				ans = calc(calc(n[0],n[1],s[j/9]),calc(n[2],n[3],s[j%3]),s[j/3%3]);
				if (ans == 10){
					cout << "(" << n[0] << s[j/9] << n[1] << ")" << s[j/3%3] << "(" << n[2] << s[j%3] << n[3] << ")"<< endl;
					findans = true;
					break;
				}
				ans = calc(calc(n[0],calc(n[1],n[2],s[j/3%3]),s[j/9]),n[3],s[j%3]);
				if (ans == 10){
					cout << "(" << n[0] << s[j/9] << "(" << n[1] << s[j/3%3] << n[2] << "))" << s[j%3] << n[3] << endl;
					findans = true;
					break;
				}
				
				ans = calc(n[0],calc(calc(n[1],n[2],s[j/3%3]),n[3],s[j%3]),s[j/9]);
				if (ans == 10){
					cout << n[0] << s[j/9] << "((" << n[1] << s[j/3%3] << n[2] << ")" << s[j%3] << n[3] << ")=" << endl;
					findans = true;
					break;
				}
				ans = calc(n[0],calc(n[1],calc(n[2],n[3],s[j%3]),s[j/3%3]),s[j/9]);  
				if (ans == 10){
					cout << n[0] << s[j/9] << "(" << n[1] << s[j/3%3] << "(" << n[2] << s[j%3] << n[3] << "))"<< endl;
					findans = true;
					break;
				}
      }
			if(findans) break;
    }while(next_permutation(n,n+4));
		if(!findans)
			cout<<"0"<<endl;
		
		findans = false;
  }
  return 0;
}