#include<iostream>
#include<string>
#include<vector>
#include<algorithm>

using namespace std;

bool input(int num[4])
{
	int zero=0;
	for(int i=0;i<4;i++)
	{
		cin>>num[i];
		if(num[i]==0)
		{
			zero++;
		}
	}
	if(zero==4)
	{
		return false;
	}
	else
	{
		return true;
	}
}

char ope[3]={'*','+','-'};

#define OPE 0
#define NUM 1

int type[5][7]={
	{NUM,NUM,NUM,NUM,OPE,OPE,OPE},
	{NUM,NUM,NUM,OPE,NUM,OPE,OPE},
	{NUM,NUM,NUM,OPE,OPE,NUM,OPE},
	{NUM,NUM,OPE,NUM,NUM,OPE,OPE},
	{NUM,NUM,OPE,NUM,OPE,NUM,OPE}
};

int elmtype(char c)
{
	if('0'<=c&&c<='9')
	{
		return NUM;
	}
	else
	{
		return OPE;
	}
}

bool check(char exp[7], int tp[7])
{
	for(int i=0;i<7;i++)
	{
		if(elmtype(exp[i])!=tp[i])
		{
			return false;
		}
	}
	return true;
}

bool check(char exp[7])
{
	for(int i=0;i<5;i++)
	{
		if(check(exp,type[i]))
		{
			return true;
		}
	}
	return false;
}

int calc(char exp[7])
{
	vector<int> stk;
	for(int i=0;i<7;i++)
	{
		if(elmtype(exp[i])==NUM)
		{
			stk.push_back(exp[i]-'0');
		}
		else
		{
			int a,b,c;
			a=stk.back(); stk.pop_back();
			b=stk.back(); stk.pop_back();
			if(exp[i]=='*')
			{
				c=b*a;
			}
			else if(exp[i]=='+')
			{
				c=b+a;
			}
			else
			{
				c=b-a;
			}
			stk.push_back(c);
		}
	}
	return stk.back();
}

string conv(char exp[7])
{
	vector<string> stk;
	for(int i=0;i<7;i++)
	{
		if(elmtype(exp[i])==NUM)
		{
			string s;
			s.push_back(exp[i]);
			stk.push_back(s);
		}
		else
		{
			string a,b,c;
			a=stk.back(); stk.pop_back();
			b=stk.back(); stk.pop_back();
			c.push_back('(');
			c.append(b);
			c.push_back(' ');
			c.push_back(exp[i]);
			c.push_back(' ');
			c.append(a);
			c.push_back(')');
			stk.push_back(c);
		}
	}
	return stk.back();
}

void sort(int num[4])
{
	for(int i=0;i<4;i++)
	{
		int min=i;
		for(int j=i+1;j<4;j++)
		{
			if(num[min]>num[j])
			{
				min=j;
			}
		}
		int tmp=num[i];
		num[i]=num[min];
		num[min]=tmp;
	}
}

string solve(int num[4])
{
	sort(num);
	for(int i=0;i<3;i++){
		for(int j=i;j<3;j++){
			for(int k=j;k<3;k++){
				char exp[7]={num[0]+'0',num[1]+'0',num[2]+'0',num[3]+'0',ope[i],ope[j],ope[k]};
				while(next_permutation(exp,exp+7))
				{
					if(check(exp)&&calc(exp)==10)
					{
						return conv(exp);
					}
				}
			}
		}
	}
	return "0";
}

int main(void)
{
	int num[4];
	while(input(num))
	{
		cout<<solve(num)<<endl;
	}
	return 0;
}