#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <deque>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <complex>
#include <functional>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cctype>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define debug(n) cout<<__FILE__<<","<<__LINE__<<": #"<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,n) repi(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(c,i) for(iter(c) i=(c).begin();i!=(c).end();i++)
#define allof(c) (c).begin(),(c).end()
#define mp make_pair

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;

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

string to_string(int n)
{
	ostringstream oss;
	oss<<n;
	return oss.str();
}

string solve(int a[])
{
	int b[4]={0,1,2,3};
	do{
		int c[4];
		rep(i,4)
			c[i]=a[b[i]];
		string f=get_formula(c[0],c[1],c[2],c[3]);
		if(f.size()){
			string res;
			for(int i=0,j=0;i<f.size();i++){
				if(islower(f[i]))
					res+=to_string(c[j++]);
				else
					res+=f[i];
			}
			return res;
		}
	}while(next_permutation(b,b+4));
	return "0";
}

int main()
{
	for(int a[4];cin>>a[0]>>a[1]>>a[2]>>a[3],a[0]|a[1]|a[2]|a[3];)
		cout<<solve(a)<<endl;
	
	return 0;
}

Measured memory_bytes: 0