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

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

int calc(string exp,int &idx){
	int count = 0, val[2];
	char op;

	for(;idx<exp.length();idx++){
		if(count == 2) break;
		if(exp[idx] == '('){
			idx++;
			val[count++] = calc(exp,idx);
		}
		else if(exp[idx] == ')'){
			idx++;
			break;
		}
		else if('1' <= exp[idx] && exp[idx] <= '9'){
			val[count++] = exp[idx] - '0';
		}
		else op = exp[idx];
	}

	if(op == '+') return val[0] + val[1];
	if(op == '-') return val[0] - val[1];
	if(op == '*') return val[0] * val[1];
}

int main(void){
	char op[4] = "+-*";
	int pos[6][4] = {
		{-5,-3,0,0},
		{-7,4,-3,0},
		{-5,-5,2,0},
		{-7,-5,2,2},
		{-7,4,-3,0},
		{-7,-7,4,2}
	};

	while(1){
		vector<int> v;
		bool ansFlg = false;

		rep(i,4){
			int x;
			cin>>x;
			if(x == 0) return 0;
			v.push_back(x);
		}

		sort(v.begin(),v.end());
		do{
			rep(i,3)rep(j,3)rep(k,3)rep(l,6){
				stringstream ss;
				ss<<v[0]<<op[i];
				ss<<v[1]<<op[j];
				ss<<v[2]<<op[k];
				ss<<v[3];

				string exp = ss.str();
				rep(m,4){
					exp.insert(abs(pos[l][m]), (pos[l][m]>=0 ? "(" : ")"));
				}
				int idx = 0;
				int res = calc(exp,idx);
				if(res == 10){
					cout<<exp<<endl;
					ansFlg = true;
					i = j = k = 3;
					l = 6;
				}
			}
		}while(!ansFlg && next_permutation(v.begin(),v.end()));

		if(!ansFlg) cout<<"0\n";
	}

	return 0;
}