
#include <iostream>
#include <algorithm>

using namespace std;

int func(int x, int y, char symbol) {
	switch (symbol) {
	case '+':return x + y;
	case '-':return x - y;
	default :return x * y;
	}
}


int main(void) {
	int i, j, k, flag;
	int arr[4] = { 0 };
	const char mathSymbol[] = { '+','-','*' };

	while (1) {
		for (i = 0; i < 4; i++) {
			cin >> arr[i];
			if (arr[i] == 0) {
				return 0;
			}
		}

		sort(arr, arr + 4);

		flag = 1;
		do {
			for (i = 0; i < 3; i++) {
				for (j = 0; j < 3; j++) {
					for (k = 0; k < 3; k++) {
						if (func(func(func(arr[0], arr[1], mathSymbol[i]), arr[2], mathSymbol[j]), arr[3], mathSymbol[k]) == 10) {
							flag = 0;
							cout << "(((" << arr[0] << mathSymbol[i] << arr[1] << ")" << mathSymbol[j] << arr[2] << ")" << mathSymbol[k] << arr[3] << ")" << endl;
							break;
						}

						if (func(func(arr[0], arr[1], mathSymbol[i]), func(arr[2], arr[3], mathSymbol[k]), mathSymbol[j]) == 10) {
							flag = 0;
							cout << "((" << arr[0] << mathSymbol[i] << arr[1] << ")" << mathSymbol[j] << "(" << arr[2] << mathSymbol[k] << arr[3] << "))" << endl;
							break;
						}

						if (func(func(arr[0], func(arr[1], arr[2], mathSymbol[j]), mathSymbol[i]), arr[3], mathSymbol[k]) == 10) {
							flag = 0;
							cout << "((" << arr[0] << mathSymbol[i] << "(" << arr[1] << mathSymbol[j] << arr[2] << "))" << mathSymbol[k] << arr[3] << ")" << endl;
							break;
						}

					}
					if (flag == 0) {
						break;
					}
				}
				if (flag == 0) {
					break;
				}
			}
		} while (flag && next_permutation(arr, arr + 4));

		if (flag == 1) {
			cout << "0" << endl;
		}


	}

	return 0;
}






