#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;
}
