#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <sstream>
#include <stack>
using namespace std;
bool check(char a,char b)
{
	if(a>b)return true;
	return false;
}
int cc(int a,int b,char c)
{
	switch(c)
	{
	case '+':return a+b;
	case '-':return a-b;
	case '*':return a*b;
		
	}
}


int calc(string a)
{
	stack<char> s;
	string buf;
	cout<<a<<endl;
	for(int i=0;i<a.size();i++)
	{
		cout<<buf<<endl;
		if('0'<=a[i]&&a[i]<='9')
		{
			buf+=a[i];
			continue;
		}
		else if(a[i]==')')
		{
			while(!s.empty())
			{
				if(s.top()=='(')
				{
					s.pop();
					break;
				}
				else
				{
					buf+=s.top();
					s.pop();
				}
			}
			continue;
		}
		else if(a[i]=='(')
		{
			s.push('(');
			continue;
		}
		;;P:;;
		if(s.empty())
		{
			s.push(a[i]);
			continue;
		}
		else
		{
			int t=0;
			for(t=0;s.top()=='(';t++,s.pop());
			if(s.top()<a[i])
			{
				buf+=s.top();
				s.pop();
				for(int l=0;l<t;l++)s.push('(');
				goto P;
			}
			else
			{
				for(int l=0;l<t;l++)s.push('(');
				s.push(a[i]);
			}
		}
	}
	while(!s.empty()){buf+=s.top();s.pop();};
	cout<<buf<<endl;
	stack<int> ss;
	int ans=0;
	for(int i=0;i<buf.size();i++)
	{
		if('0'<=buf[i]&&buf[i]<='9')
		{
			ss.push(buf[i]-'0');
		}
		else
		{
			int A,B;
			A=ss.top();ss.pop();
			B=ss.top();ss.pop();
			ss.push(cc(A,B,buf[i]));
		}
		
	}
	cout<<ss.top()<<endl;
	return ss.top();
	
}


int main()
{
	while(true)
	{
		vector<int> a;
		for(int i=0;i<4;i++)
		{
			int x;
			cin>>x;
			a.push_back(x);
		}
		for(int i=0;i<4;i++)
		{
			if(a[i]!=0)break;
			if(i==3)return 0;
		}
		string op="+-*";
		do
		{
			for(int i=0;i<3;i++)
			{
				for(int l=0;l<3;l++)
				{
					for(int k=0;k<3;k++)
					{
						char str[150];
						string s;
						
						sprintf(str,"%d%c%d%c%d%c%d",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
						if(calc((string)str)==10)
						{
							printf("%d%c%d%c%d%c%d\n",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
							goto end;
						}
						
						sprintf(str,"(%d%c%d)%c%d%c%d",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
						if(calc((string)str)==10)
						{
							printf("(%d%c%d)%c%d%c%d\n",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
							goto end;
						}
						
						sprintf(str,"%d%c(%d%c%d)%c%d",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
						if(calc((string)str)==10)
						{
							printf("%d%c(%d%c%d)%c%d\n",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
							goto end;
						}
						
						sprintf(str,"%d%c%d%c(%d%c%d)",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
						if(calc((string)str)==10)
						{
							printf("%d%c%d%c(%d%c%d)\n",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
							goto end;
						}
						
						sprintf(str,"((%d%c%d)%c%d)%c%d",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
						if(calc((string)str)==10)
						{
							printf("((%d%c%d)%c%d)%c%d\n",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
							goto end;
						}
						
						sprintf(str,"(%d%c(%d%c%d))%c%d",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
						if(calc((string)str)==10)
						{
							printf("(%d%c(%d%c%d))%c%d\n",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
							goto end;
						}
						
						sprintf(str,"%d%c((%d%c%d)%c%d)",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
						if(calc((string)str)==10)
						{
							printf("%d%c((%d%c%d)%c%d)\n",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
							goto end;
						}
						
						sprintf(str,"%d%c(%d%c(%d%c%d))",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
						if(calc((string)str)==10)
						{
							printf("%d%c(%d%c(%d%c%d))\n",a[0],op[i],a[1],op[l],a[2],op[k],a[3]);
							goto end;
						}
					}
				}
			}
		}while(next_permutation(a.begin(),a.end()));
		;end:;
		
	}
}