Problem: Using the given four integers from 1 to 9, we create an expression that gives an answer of 10. When you enter four integers a, b, c, d, write a program that outputs an expression that gives an answer of 10 according to the following conditions. Also, if there are multiple answers, only the first answer found will be output. If there is no answer, output 0.

* Use only addition (+), subtraction (-), and multiplication (*) as operators. Do not use division (/). You can use three operators.
* You must use all four numbers.
* You can freely change the order of the four numbers.
* You can use parentheses. You can use up to 3 sets (6) of parentheses.



Input

Given multiple datasets. The format of each dataset is as follows:


a b c d

Input ends with four 0s. The number of datasets does not exceed 40.

Output

For each dataset, combine the given four integers with the above arithmetic symbols and parentheses to output an expression or 0 with a value of 10 on one line. The expression string must not exceed 1024 characters.

Example

Input

8 7 9 9
4 4 4 4
5 5 7 5
0 0 0 0


Output

((9 * (9 - 7)) - 8)
0
((7 * 5) - (5 * 5))

Solution (in CPP):

Solution:
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T> inline string tostr(T x) {ostringstream sout;sout<<x;return sout.str();}


vint vec;
map<int, char> ma;

string solve(vint vec) {
	sort(ALL(vec));

	bool ok = false;
	int ans[3];
	do {
		// (((a ? b) ? c) ? d)
		int cal[3];
		for (cal[0] = 0; cal[0] < 3; ++cal[0]) {
			for (cal[1] = 0; cal[1] < 3; ++cal[1]) {
				for (cal[2] = 0; cal[2] < 3; ++cal[2]) {
					int res = vec[0];
					for (int k = 0; k < 3; ++k) {
						if (cal[k] == 0) res = res + vec[k+1];
						else if (cal[k] == 1) res = res - vec[k+1];
						else res = res * vec[k+1];
					}
					if (res == 10) {
						ok = true;
						ans[0] = cal[0], ans[1] = cal[1], ans[2] = cal[2];
					}
				}
			}
		}
		if (ok) {
			string res = "((" + tostr(vec[0]) + ma[ans[0]] + tostr(vec[1]) + ")"
				+ ma[ans[1]] + tostr(vec[2]) + ")" + ma[ans[2]] + tostr(vec[3]);
			return res;
		}

		// ((a ? b) ? (c ? d)
		for (cal[0] = 0; cal[0] < 3; ++cal[0]) {
			for (cal[1] = 0; cal[1] < 3; ++cal[1]) {
				for (cal[2] = 0; cal[2] < 3; ++cal[2]) {
					int res, tmp[2];
					for (int k = 0; k < 2; ++k) {
						if (cal[k] == 0) tmp[k] = vec[k*2] + vec[k*2+1];
						else if (cal[k] == 1) tmp[k] = vec[k*2] - vec[k*2+1];
						else tmp[k] = vec[k*2] * vec[k*2+1];
					}
					if (cal[2] == 0) res = tmp[0] + tmp[1];
					else if (cal[2] == 1) res = tmp[0] - tmp[1];
					else res = tmp[0] * tmp[1];

					if (res == 10) {
						ok = true;
						ans[0] = cal[0], ans[1] = cal[1], ans[2] = cal[2];
					}
				}
			}
		}
		if (ok) {
			string res = "(" + tostr(vec[0]) + ma[ans[0]] + tostr(vec[1]) + ")"
				+ ma[ans[2]] + "(" + tostr(vec[2]) + ma[ans[1]] + tostr(vec[3]) + ")";
			return res;
		}

	} while (next_permutation(ALL(vec)));

	return "0";
}

int main() {
	ma[0] = '+'; ma[1] = '-'; ma[2] = '*';
	vec.resize(4);
	while (cin >> vec[0] >> vec[1] >> vec[2] >> vec[3]) {
		if (vec[0] == 0 && vec[1] == 0 && vec[2] == 0 && vec[3] == 0) break;
		cout << solve(vec) << endl;
	}
    
    return 0;
}