#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repb(i,a,b) for(int i=a;i>=b;i--)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
//#define int long long
#define fi first
#define se second
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

int calc(int a, int b, char op){
	if(op=='+') return a+b;
	if(op=='-') return a-b;
	if(op=='*') return a*b;
}


signed main() {
	while (1) {
		int sum = 0;
		vi d;
		rep(i, 0, 4) {
			int num;
			cin >> num;
			d.push_back(num);
			sum += d[i];
		}
		if (sum == 0) break;
		bool f = false;
		char op[4] = { "+-*" };
		do {
			/*rep(i, 0, 4) {
				cout << d[i] << " ";
			}
			cout << endl;*/
			rep(i, 0, 3) {
				rep(j, 0, 3) {
					rep(k, 0, 3) {
						int t1 = calc(d[0], d[1], op[i]);
						int t2 = calc(d[2], d[3], op[k]);
						int t3 = calc(t1, d[2], op[j]);
						if (calc(t1, t2, op[j]) == 10) {
							//cout<<"("<<d[0]<<op[i]<<d[1]<<")"<<op[j]<<"("

							printf("(%d %c %d) %c (%d %c %d)\n", d[0], op[i], d[1], op[j], d[2], op[k], d[3]);
							k = 3; j = 3; i = 3; f = true;
						}
						else if (calc(t3, d[3], op[k]) == 10) {
							printf("((%d %c %d) %c %d) %c %d\n", d[0], op[i], d[1], op[j], d[2], op[k], d[3]);
							k = 3; j = 3; i = 3; f = true;
						}
					}
				}
			}
			if (f) break;
		} while (next_permutation(all(d)));
		if (f == false) cout << 0 << endl;
	}
}