#include<iostream>
#include<vector>
#define all(c) c.begin(),c.end()
#include<cstring>
#include<set>
#include<map>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
int f(int a,int b,char c){
	if(c=='+')
		return a+b;
	if(c=='-')
		return a-b;
	if(c=='*')
		return a*b;
	return 100000;
}
int main(){
	vector<int> v(4);
	while(cin>>v[0]>>v[1]>>v[2]>>v[3],v[0]||v[1]||v[2]||v[3]){
		sort(all(v));
		string s="+++---***";
		sort(all(s));
		do{
			
			do{
				
				int a=f(v[0],v[1],s[0]);
				int b=f(v[1],v[2],s[1]);
				int c=f(v[2],v[3],s[2]);
				//(() )
					
				if(f(f(a,v[2],s[1]),v[3],s[2])==10){
					printf("((%d%c%d)%c%d%c%d)\n",v[0],s[0],v[1],s[1],v[2],s[2],v[3]);
					goto end;
				}
				//( ())
				if(f(f(v[0],v[1],s[0]),c,s[1])==10){
					printf("(%d%c%d%c(%d%c%d))\n",v[0],s[0],v[1],s[1],v[2],s[2],v[3]);
					goto end;
				}
				//(()())
				if(f(a,c,s[1])==10){
					printf("((%d%c%d)%c(%d%c%d))\n",v[0],s[0],v[1],s[1],v[2],s[2],v[3]);
					goto end;
				}
				//( () )
				if(f(f(v[0],b,s[0]),v[3],s[2])==10){
					printf("(%d%c(%d%c%d)%c%d)\n",v[0],s[0],v[1],s[1],v[2],s[2],v[3]);
					goto end;
				}
			}while(next_permutation(all(s)));
		}while(next_permutation(all(v)));
		cout<<0<<endl;
		end:;
	}
	return 0;
}