#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()
#define INF 1<<30
#define INF2 255
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

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

int rev_polish (string str )
{
	int len = str.length();
	int res = 0;
	stack <int> st;
	int i = 0;

	while (i < len ){
		if( isdigit( str[i] ) ){
			int n = (int)(str[i] - '0');
			st.push(n);
		}else{	// operator come
			if (st.empty() ){
				return INF;
			} // end if 
			int y = st.top();
			st.pop();
			if (st.empty() ){
				return INF;
			} // end if 
			int x = st.top();
			st.pop();
			char c = str[i];
			int res = 0;
			switch (c ){
				case '+':
					res = x + y; st.push(res ); break;
				case '-':
					res = x - y; st.push(res ); break;
				case '*':
					res = x * y; st.push(res ); break;
			} // end switch	
		} // end if
		++i;
	} // end while

	res = st.top();

	return res;
}


char tree[1000];
int m; // m は文字列の位置、
void dfs (int n, string s )	// n は木の位置
{
	if (m < 0 ) return;
	tree[n] = s[m--];

	if (isdigit (tree[n] ) ){
		return;
	} // end if
	dfs (2*n+2, s );
	dfs (2*n+1, s );
}

string res2;

void disp_exp (int n )
{
	if (tree[n] == (char)INF2 ) return;

	if (!isdigit (tree[n] ) ) res2 += '(';
	disp_exp (2*n+1);
	res2 += ' ';
	res2 += tree[n];
	res2 += ' ';
	disp_exp (2*n+2);
	if (!isdigit (tree[n] ) ) res2 += ')';
}

int main()
{
//	cut here before submit 
//	freopen ("testcase.Expression", "r", stdin );

	int a, b, c, d;
	while (1 ){
		scanf ("%d %d %d %d", &a, &b, &c, &d );
		if (a == 0 && b == 0 && c == 0 && d == 0 ) break;
		string exp = "";
		exp += (char)(a+'0'); exp += (char)(b+'0'); exp += (char)(c+'0'); exp += (char)(d+'0');
		rep (i, 3 )
			exp += 'e';
		sort (ALL (exp ) );
		bool found = false;
		string res = "";
		do{
			rep (i, 27 ){
				int ans = INF;
				int n = exp.length();
				string e = exp;
				int cnt = 0;
				rep (j, n ){
					if (exp[j] == 'e' ){
						switch (cnt ){
							case 0: e[j] = ope[i/9]; break;
							case 1: e[j] = ope[(i/3) % 3]; break;
							case 2: e[j] = ope[i%3]; break;
						} // end switch
						cnt++;
					} // end if
				} // end rep
				if ((ans = rev_polish (e ) )!= INF ){
//					cout << e << " = " << ans << endl;
					if (ans == 10 ){
						res = e;
						found = true;
						break;
						//cout << e << endl;
					} // end if
				} // end if
			} // end rep
			if (found ) break;	
		}while (next_permutation (ALL (exp ) ) );

		if (!found ){
			cout << 0 << endl;
		}else{
			fill (tree, tree+1000, (char)INF2 );
			m = res.size() - 1;
			dfs (0, res );
			res2 = "";
			disp_exp (0 );
			cout << res2 << endl;
		} // end if	 
	} // end while

	return 0;
}