#include<bits/stdc++.h>

using namespace std;

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

typedef string::const_iterator State;
class ParseError {};

int expression(State &begin);
int term(State &begin);
int number(State &begin);
int factor(State &begin);

int number(State &begin) {
	int ret = 0;

	while (isdigit(*begin)) {
		ret *= 10;
		ret += *begin - '0';
		begin++;
	}
	return ret;
}

int term(State &begin) {
	int ret = factor(begin);

	for (;;) {
		if (*begin == '*') {
			begin++;
			ret *= factor(begin);
		} else if (*begin == '/') {
			begin++;
			ret /= factor(begin);
		} else {
			break;
		}
	}
	return ret;
}

int expression(State &begin) {
	int ret = term(begin);

	for (;;) {
		if (*begin == '+') {
			begin++;
			ret += term(begin);
		} else if (*begin == '-') {
			begin++;
			ret -= term(begin);
		} else {
			break;
		}
	}

	return ret;
}

int factor(State &begin) {
	if (*begin == '(') {
		begin++;
		int ret = expression(begin);
		begin++;
		return ret;
	} else {
		return number(begin);
	}
}

string itos(int number) {
	stringstream ss;
	ss << number;
	return ss.str();
}

int main(void) {
	vector<int> v(4);
	while(true){
		for(int i=0; i < 4; i++) cin >> v[i];
		if(v[0]+v[1]+v[2]+v[3] == 0) break;

		string symbol = "+-*";

		rep(i, 3)rep(j, 3)rep(k, 3){
			if(i+j-k < 0 || j != 0 && k != 0) continue;
			rep(l, 3)rep(m, 3){
				if(i+j-k+l-m < 0 || l != 0 && m != 0) continue;
				for(int n=0; n < 3; n++){ //)4
					if(i+j-k+l-m-n != 0 || 6 < i+j+k+l+m+n) continue;

					do{
						rep(a, 3)rep(b, 3)rep(c, 3){
							string ex;
							for(int p=0; p < i; p++) ex += "(";
							ex += itos(v[0]);
							ex += symbol[a];
							for(int p=0; p < j; p++) ex += "(";
							ex += itos(v[1]);
							for(int p=0; p < k; p++) ex +=  ")";
							ex += symbol[b];
							for(int p=0; p < l; p++) ex +=  "(";
							ex += itos(v[2]);
							for(int p=0; p < m; p++) ex +=  ")";
							ex += symbol[c];
							ex += itos(v[3]);
							for(int p=0; p < n; p++) ex +=  ")";

							State begin = ex.begin();
							if(expression(begin) == 10){
								rep(q, ex.size()-1){
									if(symbol.find(ex[q+1]) != string::npos){
										cout << ex[q] << " " << ex[q+1] << " ";
										q++;
									}
									else cout << ex[q];
								}
								cout << ex[ex.size()-1] << endl;
								goto end_state;
							}
						}
					}while(next_permutation(v.begin(), v.end()));
				}
			}
		}
		cout << 0 << endl;
end_state:;
	}
	return 0;
}