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

int number[4];

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

int solve(int c, int o);
int check();
void makeEx(int type);
int culc(int a, int c, int b);

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) == 0)
			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() {
	if (culc( culc( culc( num[0], ope[0], num[1]), ope[1], num[2]), ope[2], num[3]) == 10) {
		makeEx(1);
		return 1;
	}
	if (culc( culc(num[0], ope[0], num[1]), ope[1], culc(num[2], ope[2], num[3])) == 10) {
		makeEx(2);
		return 1;
	}
	return 0;
}

int culc(int a, int c, int b) {
	int ans = a;
	switch (c) {
	case 0:
		ans += b;
		break;
	case 1:
		ans -= b;
		break;
	case 2:
		ans *= b;
		break;
	}
	return ans;
}

void makeEx(int type) {
	char c[3];
	int i;
	for (i = 0; i < 3; i++) {
		switch (ope[i]) {
		case 0:
			c[i] = '+';
			break;
		case 1:
			c[i] = '-';
			break;
		case 2:
			c[i] = '*';
			break;
		}
	}
	if (type == 1)
		printf("(((%d %c %d) %c %d) %c %d)", num[0], c[0], num[1], c[1], num[2], c[2], num[3]);
	else
		printf("((%d %c %d) %c (%d %c %d))", num[0], c[0], num[1], c[1], num[2], c[2], num[3]);
	putchar('\n');
}