#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); ++i)

string op = "+-*";
int a[4];

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

void solve() {
	sort(a, a+4);
	string ret = "";
	do {
		rep(i,3) rep(j,3) rep(k,3) {
			if (calc(calc(calc(a[0], op[i], a[1]), op[j], a[2]), op[k], a[3]) == 10) {
				printf("((%d %c %d) %c %d) %c %d\n", a[0], op[i], a[1], op[j], a[2], op[k], a[3]);
				return ;
			}
			if (calc(calc(a[0], op[i], a[1]), op[j], calc(a[2], op[k], a[3])) == 10) {
				printf("(%d %c %d) %c (%d %c %d)\n", a[0], op[i], a[1], op[j], a[2], op[k], a[3]);
				return ;
			}
		}
	} while (next_permutation(a, a+4));
	printf("0\n");
}

int main() {
	while (cin >> a[0] >> a[1] >> a[2] >> a[3], a[0]) {
		solve();
	}
	return 0;
}