#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

#define DATA_SIZE 4

int calc(int num1, int num2, string op){
	if(op == " + "){
		return num1 + num2;
	}else if(op == " - "){
		return num1 - num2;
	}else if(op == " * "){
		return num1 * num2;
	}
	return (1 << 24); // ??§????????°
}

void search(int a[3]){
	
	string op[3] = {" + ", " - ", " * "};
	sort(a, a + DATA_SIZE);
	
	do{
		for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
				for(int k = 0; k < 3; k++){
					if(calc(calc(calc(a[0], a[1], op[i]), a[2], op[j]), a[3], op[k]) == 10){
						cout << "(((" << a[0] << op[i] << a[1] << ")" << op[j] << a[2] << ")" << op[k] << a[3] << ")" << endl;
						return;
					}
					if(calc(calc(a[0], calc(a[1], a[2], op[i]), op[j]), a[3], op[k]) == 10){
						cout << "((" << a[0] << op[j] << "(" << a[1] << op[i] << a[2] << "))" << op[k] << a[3] << ")" << endl;
						return;
					}
					if(calc(a[0], calc(calc(a[1], a[2], op[i]), a[3], op[j]), op[k]) == 10){
						cout << "(" << a[0] << op[k] << "((" << a[1] << op[i] << a[2] << ")" << op[j] << a[3] << "))" << endl;
						return;
					}
					if(calc(a[0], calc(a[1], calc(a[2], a[3], op[i]), op[j]), op[k]) == 10){
						cout << "(" << a[0] << op[k] << "(" << a[1] << op[j] << "(" << a[2] << op[i] << a[3] << ")))" << endl;
						return;
					}
					if(calc(calc(a[0], a[1], op[i]), calc(a[2], a[3], op[j]), op[k]) == 10){
						cout << "((" << a[0] << op[i] << a[1] << ")" << op[k] << "(" << a[2] << op[j] << a[3] << "))" << endl;
						return;
					}
				}
			}
		}
	}while(next_permutation(a, a + DATA_SIZE));
	cout << "0" << endl;
	return;
}

int main(){
	int a[DATA_SIZE];
	while(true){
		
		bool flag = true;
		
		for(int i = 0; i < DATA_SIZE; i++){
			cin >> a[i];
			if(a[i] != 0){
				flag = false;
			}
		}
		if(flag){
			break;
		}
		
		search(a);
	}
	
	
	return 0;
}