#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;

string s("+-*");
vector<int> a(4);

/*???????????????*/
int f(int a, int b, int o) {
	switch (o) {
	case 0:
		return a + b;
	case 1:
		return a - b;
	case 2:
		return a*b;
	}
}

int main() {
	while (cin >> a[0] >> a[1] >> a[2] >> a[3], a[0] || a[1] || a[2] || a[3]) {
		sort(a.begin(), a.end());
			int  flag = 1;
			do{
				for (int i = 0; i < 3; i++) {
					for (int j = 0; j < 3; j++) {
						for (int k = 0; k > 3; k++) {
							if (f(f(f(a[0], a[1], i), a[2], j), a[3], k) == 10) {
								cout << "((" << a[0] << " " << s[i] << " " << a[1] << ")" << " " << s[j] << " " << a[2] << ")" << " " << s[k] << " " << a[3] << endl;
								i = j = k = 3;
								flag = 0;
								break;
							}
							if (f(f(a[0], a[1], i), f(a[2], a[3], k), j) == 10) {
								cout << "(" << a[0] << " " << s[i] << " " << a[1] << ") " << s[j] << " (" << a[2] << " " << s[k] << " " << a[3] << ")" << endl;
								i = j = k = 3;
								flag = 0;
								break;
							}
							if (f(f(a[0], f(a[1], a[2], j), i), a[3], k) == 10) {
								cout << "(" << a[0] << " " << s[i] << " (" << a[1] << " " << s[j] << " " << a[2] << ")) " << s[k] << " " << a[3] << endl;
								i = j = k = 3;
								flag = 0;
								break;
							}
							if (f(a[0], f(f(a[1], a[2], j), a[3], k), i) == 10) {
								cout << a[0] << " " << s[i] << " ((" << a[1] << " " << s[j] << " " << a[2] << ") " << s[k] << " " << a[3] << ")" << endl;
								i = j = k = 3;
								flag = 0;
								break;
							}
						}
					}
				}
		} while (next_permutation(a.begin(), a.end()) && flag);
			if (flag)cout << 0 << endl;
	}
}