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<cstdio>
#include<iostream>
#include<string>

using namespace std;

string str;
char cc[4]={'a','+','-','*'};
char cn[5]={'q','a','b','c','d'};
int calc(int a,int b,int c){
	if(c==1) return a+b;
	if(c==2) return a-b;
	if(c==3) return a*b;
}

bool solve(int a,int b,int c,int d){
	bool f=false;;
	int be=-1000,af=-1000,ch=-1000;
	int sum=0,ans;
	if(a==-1000) sum++;
	else ans=a;
	if(b==-1000) sum++;
	else ans=b;
	if(c==-1000) sum++;
	else ans=c;
	if(d==-1000) sum++;
	else ans=d;
	if(sum==3){
		if(ans==10) return true;
		else return false;
	}

	if(a!=-1000&&f==false){
		for(int i=1;i<=3;i++){
			if(b!=-1000&&f==false){
				if(f==false) be=1,af=2,ch=i;
				f=solve(-1000,calc(a,b,i),c,d);
			}
			if(c!=-1000&&f==false){
				if(f==false) be=1,af=3,ch=i;
				f=solve(-1000,b,calc(a,c,i),d);
			}
			if(d!=-1000&&f==false){
				if(f==false) be=1,af=4,ch=i;
				f=solve(-1000,b,c,calc(a,d,i));
			}
		}
	}
	if(b!=-1000&&f==false){
		for(int i=1;i<=3;i++){
			if(a!=-1000&&f==false){
				if(f==false) be=2,af=1,ch=i;
				f=solve(calc(b,a,i),-1000,c,d);
			}
			if(c!=-1000&&f==false){
				if(f==false) be=2,af=3,ch=i;
				f=solve(a,-1000,calc(b,c,i),d);
			}
			if(d!=-1000&&f==false){
				if(f==false) be=2,af=4,ch=i;
				f=solve(a,-1000,c,calc(b,d,i));
			}
		}
	}
	if(c!=-1000&&f==false){
		for(int i=1;i<=3;i++){
			if(a!=-1000&&f==false){
				if(f==false) be=3,af=1,ch=i;
				f=solve(calc(c,a,i),b,-1000,d);
			}
			if(b!=-1000&&f==false){
				if(f==false) be=3,af=2,ch=i;
				f=solve(a,calc(c,b,i),-1000,d);
			}
			if(d!=-1000&&f==false){
				if(f==false) be=3,af=4,ch=i;
				f=solve(a,b,-1000,calc(c,d,i));
			}
		}
	}
	if(d!=-1000&&f==false){
		for(int i=1;i<=3;i++){
			if(a!=-1000&&f==false){
				if(f==false) be=4,af=1,ch=i;
				f=solve(calc(d,a,i),b,c,-1000);
			}
			if(b!=-1000&&f==false){
				if(f==false) be=4,af=2,ch=i;
				f=solve(a,calc(d,b,i),c,-1000);
			}
			if(c!=-1000&&f==false){
				if(f==false) be=4,af=3,ch=i;
				f=solve(a,b,calc(d,c,i),-1000);
			}
		}
	}
	if(f==true){
		if(be!=-1000&&af!=-1000&&ch!=-1000){
			if(str.empty()){
				str='(';
				str+=cn[be];
				str+=cc[ch];
				str+=cn[af];
				str+=')';
				
			}
			else{
				if(str.find(cn[be])!=-1){
					int pos=str.find(cn[be]);
					str.erase(pos,1);
					str.insert(pos,"(");
					str.insert(pos+1,1,cn[be]);
					str.insert(pos+2,2,cc[ch]);
					str.insert(pos+3,3,cn[af]);
					str.insert(pos+4,")");
				}
				else if(str.find(cn[af])!=-1){
					int pos=str.find(cn[af]);
					str.erase(pos,1);
					str.insert(pos,"(");
					str.insert(pos+1,1,cn[be]);
					str.insert(pos+2,1,cc[ch]);
					str.insert(pos+3,1,cn[af]);
					str.insert(pos+4,")");
				}
			}
		}
		return true;
	}
	else return false;
}

int main(void){
	int a,b,c,d;
	int pos;
	while(1){
		cin>>a>>b>>c>>d;
		str=("");
		if(a==0&&b==0&&c==0&&d==0) break;
		solve(a,b,c,d);
		if(!str.empty()){
			pos=str.find('a');
			str.erase(pos,1);
			str.insert(pos,1,(char)(a+'0'));
			pos=str.find('b');
			str.erase(pos,1);
			str.insert(pos,1,(char)(b+'0'));
			pos=str.find('c');
			str.erase(pos,1);
			str.insert(pos,1,(char)(c+'0'));
			pos=str.find('d');
			str.erase(pos,1);
			str.insert(pos,1,(char)(d+'0'));
			cout<<str<<endl;
		}
		else cout<<"0"<<endl;
	}
	return 0;
}