#include <iostream>
#include <cstdio>
using namespace std;

char ans[1024];
int number[4];

int usednum[4];
int num[4];
int ope[3];

int solve(int c, int o);
int check();
void makeEx();

int main() {
	int i, count = 0;

	while (1) {
		memset(usednum, 0, sizeof(usednum));
		for (i = 0; i < 4; i++) {
			cin >> number[i];
			if (number[i] == 0)
				count++;
		}
		if (count == 4)
			break;
		if (solve(0, 0))
			cout << ans << endl;
		else
			cout << "0" << endl;
	}
	return 0;
}

int solve(int c, int o) {
	int i;

	if (c == 4 && o == 3) {
		if (check()) {
			return 1;
		}
	} else {
		if (c - o == 1) {
			for (i = 0; i < 3; i++) {
				ope[o] = i;
				if (solve(c, o + 1))
					return 1;
			}
		} else {
			for (i = 0; i < 4; i++) {
				if (!usednum[i]) {
					num[c] = number[i];
					usednum[i] = 1;
					if (solve(c + 1, o))
						return 1;
					usednum[i] = 0;
				}
			}
		}
	}
	return 0;
}

int check() {
	int ans, i;

	for (ans = num[0], i = 0; i < 3; i++) {
		switch (ope[i]) {
		case 0:
			ans += num[i+1];
			break;
		case 1:
			ans -= num[i+1];
			break;
		case 2:
			ans *= num[i+1];
			break;
		}
	}
	if (ans == 10) {
		makeEx();
		return 1;
	}
	return 0;
}

void makeEx() {

	int i = 0, j = 0, k = 0, kakko = -1;

	if ((ope[0] != 2 && (ope[1] == 2 || ope[2] == 2)) || (ope[0] == 2 && ope[1] != 2 && ope[2] == 2)) {
		ans[i++] = '(';
		if (ope[1] == 2)
			kakko = 6;
		else {
			kakko = 10;
		}
	}
	while (j != 4 || k != 3) {
		if (i == kakko) {
			ans[i++] = ')';
			continue;
		}
		if (((kakko != -1 && i >= 2) || (kakko == -1 && i >= 1)) && (j != 4 || k != 3))
			ans[i++] = ' ';
		if (j <= k) {
			ans[i++] = num[j++] + '0';
		} else {
			switch (ope[k++]) {
			case 0:
				ans[i] = '+';
				break;
			case 1:
				ans[i] = '-';
				break;
			case 2:
				ans[i] = '*';
				break;
			}
			i++;
		}
	}
	ans[i] = '\0';
	
}