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

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

int f(int x, int y, int c) {
	switch (c) {
	case 0:
		return x + y;
	case 1:
		return x - y;
	case 2:
		return x * y;
	}
}

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;
	}
	return 0;
}