Problem: Using the given four integers from 1 to 9, we create an expression that gives an answer of 10. When you enter four integers a, b, c, d, write a program that outputs an expression that gives an answer of 10 according to the following conditions. Also, if there are multiple answers, only the first answer found will be output. If there is no answer, output 0.

* Use only addition (+), subtraction (-), and multiplication (*) as operators. Do not use division (/). You can use three operators.
* You must use all four numbers.
* You can freely change the order of the four numbers.
* You can use parentheses. You can use up to 3 sets (6) of parentheses.



Input

Given multiple datasets. The format of each dataset is as follows:


a b c d

Input ends with four 0s. The number of datasets does not exceed 40.

Output

For each dataset, combine the given four integers with the above arithmetic symbols and parentheses to output an expression or 0 with a value of 10 on one line. The expression string must not exceed 1024 characters.

Example

Input

8 7 9 9
4 4 4 4
5 5 7 5
0 0 0 0


Output

((9 * (9 - 7)) - 8)
0
((7 * 5) - (5 * 5))

Solution (in CPP):

Solution:
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
using namespace std;
typedef vector<int> vint;
#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
char aaa[3]={'+','-','*'};
string temp[]={"(0 0) (0 0)","((0 0) 0) 0","0 (0 (0 0))","(0 (0 0)) 0"};
vint bbb[4];
vint ccc[4];

string calc(string in,int c){
	stringstream ss1;
	ss1<<in;
	int a,b;
	char t;
	ss1>>a>>t>>b;
	if(c==1) a=a+b;
	if(c==2) a=a-b;
	if(c==3) a=a*b;
	stringstream ss2;
	ss2<<a;
	string ans;
	ss2>>ans;
	if(ans[0]=='-') ans="43"; 
	return ans;
}
string foo(string s){
	int pos1=-1,pos2=-1;
	rep(i,s.size()){
		if(s[i]=='('){
			pos1=i;
		}
		else if(s[i]==')'){
			pos2=i;
			break;
		}
	}
	if(pos1!=-1) s=foo(s.substr(0,pos1)+foo(s.substr(pos1+1,pos2-pos1-1))+s.substr(pos2+1));
	int update=1;
	while(update){
		update=0;
		rep(i,s.size()){
			if(s[i]=='*'){
				update=1;
				int x=i-1,y=i+1;
				while(s[x]>='0'&&s[x]<='9'){
					x--;
					if(x==-1) break;
				}
				while(s[y]>='0'&&s[y]<='0'){
					y++;
					if(y==s.size()) break;
				}
				s=s.substr(0,x+1)+calc(s.substr(x+1,y-1)+s.substr(y-1),3);
				break;
			}
		}
	}
	update=1;
	while(update){
		update=0;
		rep(i,s.size()){
			if(s[i]=='+'||s[i]=='-'){
				update=1;
				int x=i-1,y=i+1;
				while(s[x]>='0'&&s[x]<='9'){
					x--;
					if(x==-1) break;
				}
				while(s[y]>='0'&&s[y]<='0'){
					y++;
					if(y==s.size()) break;
				}
				int ddd=2;
				if(s[i]=='+') ddd=1;
				s=s.substr(0,x+1)+calc(s.substr(x+1),ddd);
				break;
			}
		}
	}
	return s;
}
void mainmain(){
	int a,b,c,d;
	rep(i,3){
		rep(j,temp[i].size()){
			if(temp[i][j]=='0'){
				bbb[i].PB(j);
			}
			if(temp[i][j]==' '){
				ccc[i].PB(j);
			}
		}
	}
	int aa[4];
	vint v(4);
	vint tt(4);
	while(cin>>v[0]>>v[1]>>v[2]>>v[3],v[0]){
		sort(ALL(v));
		bool f=false;
		do{
			rep(i,3){
				string tmp=temp[i];
				rep(j,4){
					tmp[bbb[i][j]]+=v[j];
				}
				rep(j,3){
					tmp[ccc[i][0]]=aaa[j];
					rep(k,3){
						tmp[ccc[i][1]]=aaa[k];
						rep(l,3){
							tmp[ccc[i][2]]=aaa[l];
							if("10"==foo(tmp)){
								cout<<tmp<<endl;
								f=true;
								break;
							}
						}
						if(f) break;
					}
					if(f) break;
				}
				if(f) break;
			}
			if(f) break;
		}while(next_permutation(ALL(v)));
		if(!f) cout<<0<<endl;
	}
}
int main() try{
    mainmain();
}
catch(...){
}