#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
char proto[][19]={"%d%d%%c%d%%c%d%%c","%d%d%%c%d%d%%c%%c",
	"%d%d%d%%c%%c%d%%c","%d%d%d%%c%d%%c%%c","%d%d%d%d%%c%%c%%c"};
char op[]="+-*";

vector<int> stk;

string toInfix(char expr[]){
	vector<string> cstk;
	char c; char t[29];
	for(int i=0;c=expr[i];i++){
		if('0'<=c&&c<='9'){
			sprintf(t,"%c",c);
			cstk.push_back(t); continue;
		}
		int s=cstk.size();
		sprintf(t,"(%s %c %s)",cstk[s-2].c_str(),c,cstk[s-1].c_str());
		cstk.erase(cstk.end()-2,cstk.end());
		cstk.push_back(t);
	}
	return cstk[0];
}
int eval(char expr[]){
	stk.clear();
	char c;
	for(int i=0;c=expr[i];i++){
		if('0'<=c&&c<='9'){
			stk.push_back(c-'0'); continue;
		}
		int t,a=stk[stk.size()-2],b=stk[stk.size()-1];
		if(c=='+')t=a+b;
		if(c=='-')t=a-b;
		if(c=='*')t=a*b;
		stk.erase(stk.end()-2,stk.end());
		stk.push_back(t);
	}
	return stk[0];
}
int main(){
	int nm[4]; char expr[30],tmp[30];
	
	while(cin>>nm[0]>>nm[1]>>nm[2]>>nm[3]){
		if(!(nm[0]==0&&nm[1]==0&&nm[2]==0&&nm[3]==0)&&
			(nm[0]==0||nm[1]==0||nm[2]==0||nm[3]==0)){return 1;}
		if(nm[0]==0&&nm[1]==0&&nm[2]==0&&nm[3]==0)break;
		do{
			rep(o1,3)rep(o2,3)rep(o3,3)rep(e,5){
				sprintf(tmp,proto[e],nm[0],nm[1],nm[2],nm[3]);
				sprintf(expr,tmp,op[o1],op[o2],op[o3]);
				if(eval(expr)==10){
					cout<<toInfix(expr)<<endl;
					goto NEXT;
				}
			}
		}while(next_permutation(nm,nm+4));
		cout<<0<<endl;
		NEXT:;
	}
	return 0;
}