#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

#define rep(i,n) for(int i=0 ; i < n ; i++)

int calc(string c,int a,int b)
{
	if(c == "+") return a+b;
	if(c == "-") return a-b;
	if(c == "*") return a*b;
}

int main()
{
	int a[4];
	while(cin >> a[0] >> a[1] >> a[2] >> a[3] && a[0] && a[1] && a[2] && a[3])
	{
		sort(a,a+4);
		bool flag = true;
		string ope[3] = {"+","-","*"};
		do
		{
			rep(i,3)
			{
				rep(j,3)
				{
					rep(k,3)
					{
						int h = calc(ope[i],a[0],a[1]);
						int h2 = calc(ope[j],a[1],a[2]);
						int h3 = calc(ope[k],a[2],a[3]);
						if(calc(ope[j],h,h3) == 10 && flag)
						{
							cout << "(("<< a[0] << " "+ope[i] << " " << a[1] << ") "+ope[j] << " (" << a[2] << " "+ope[k] << " " << a[3] << "))" << endl;
							flag = false;
						}
						if(calc(ope[k],calc(ope[j],h,a[2]),a[3]) == 10 && flag)
						{
							cout << "(((" << a[0] << " "+ope[i] << " " << a[1] << ") "+ope[j] << " " << a[2] << ") "+ope[k] << " " << a[3] << ")" << endl;
							flag = false;
						}
						if(calc(ope[k],calc(ope[i],a[0],h2),a[3]) == 10 && flag)
						{
							cout << "((" << a[0] << " "+ope[i] << " (" << a[1] << " "+ope[j] << " " << a[2] << ")) "+ope[k] << " " << a[3] <<")" << endl; 
							flag = false;
						}
					}

				}
			}
		}while(next_permutation(a,a+4));

		if(flag) cout << 0 << endl;
	}
	return 0;
}