#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>

using namespace std;

bool Found;
char ans[30];

int calc(char arg[30]){

	int tmp,op1,work,count,work2;
	char line[30],calc;
	stack<int> NUM,work_num;
	stack<char> OP,work_op;

	int loop;
	for(loop = 0; arg[loop] != '\0';loop++)line[loop] = arg[loop];

	line[loop++] = '=';
	line[loop] = '\0';


	bool numFLG,negFLG;

	tmp = 0;
	numFLG = false;
	negFLG = false;

	for(int k = 0; line[k] != '\0'; k++){
		if(line[k] >= '0' && line[k] <= '9'){
			numFLG = true;
			tmp = 10*tmp + (line[k] - '0');

		}else{

			if(numFLG == true){

				if(negFLG){
					tmp = -1*tmp;
					negFLG = false;
				}

				if(OP.empty() == false && (OP.top() == '*' || OP.top() == '/')){
					calc = OP.top();
					OP.pop();
					op1 = NUM.top();
					NUM.pop();

					if(calc == '*'){
						NUM.push(tmp*op1);
					}else{
						NUM.push(op1/tmp);
					}
				}else{
					NUM.push(tmp);
				}

				numFLG = false;
				tmp = 0;
			}

			if(line[k] == '+' ||line[k] == '*' || line[k] == '/' || line[k] == '(' || line[k] == '-'){
				OP.push(line[k]);
			}else if(line[k] == ')'){
				work = NUM.top();
				NUM.pop();
				work_num.push(work);

				count = 0;

				while(true){
					calc = OP.top();
					OP.pop();
					if(calc == '(')break;

					count++;

					work_op.push(calc);

					work = NUM.top();
					NUM.pop();
					work_num.push(work);
				}

				if(count == 0){
					work = work_num.top();
					work_num.pop();
				}else{

					work = work_num.top();
					work_num.pop();

					while(!work_num.empty()){
						calc = work_op.top();
						work_op.pop();

						if(calc == '+'){
							work += work_num.top();
						}else if(calc == '-'){
							work -= work_num.top();
						}else if(calc == '*'){
							work *= work_num.top();
						}else{
							work /= work_num.top();
						}
						work_num.pop();
					}
				}

				if(OP.empty() == false && OP.top() == '*'){
					OP.pop();
					work2 = NUM.top();
					NUM.pop();
					work *= work2;
				}else if(OP.empty() == false &&OP.top() == '/'){
					OP.pop();
					work2 = NUM.top();
					NUM.pop();
					work = work2/work;
				}

				NUM.push(work);

			}else{
				work = NUM.top();
				NUM.pop();
				work_num.push(work);

				while(!NUM.empty()){
					calc = OP.top();
					OP.pop();

					work_op.push(calc);

					work = NUM.top();
					NUM.pop();
					work_num.push(work);
				}

				work = work_num.top();
				work_num.pop();

				while(!work_num.empty()){
					calc = work_op.top();
					work_op.pop();

					if(calc == '+'){
						work += work_num.top();
					}else if(calc == '-'){
						work -= work_num.top();
					}else if(calc == '*'){
						work *= work_num.top();
					}else{
						work /= work_num.top();
					}
					work_num.pop();
				}

				return work;
			}
		}
	}
	return -1;	//must not reach here
}


void func(int a,int b, int c,int d){

	char eq1[30],eq2[30],eq3[30],eq4[30],eq5[30],eq6[30],eq7[30],eq8[30];
	eq1[0] = '(',eq1[1] = '0' + a,eq1[2] = '?',eq1[3] = '0' + b,eq1[4] = ')',eq1[5] = '?',eq1[6] = '(',eq1[7] = '0' + c,eq1[8] = '?',eq1[9] = '0' + d,eq1[10] = ')',eq1[11] = '\0';
	eq2[0] = '0' + a,eq2[1] = '?',eq2[2] = '(',eq2[3] = '0' + b,eq2[4] = '?',eq2[5] = '0' + c,eq2[6] = ')',eq2[7] = '?',eq2[8] = '0' + d,eq2[9] = '\0';
	eq3[0] = '0' + a,eq3[1] = '?',eq3[2] = '0' + b,eq3[3] = '?',eq3[4] = '(',eq3[5] = '0' + c,eq3[6] = '?',eq3[7] = '0' + d,eq3[8] = ')' + d,eq3[9] = '\0';
	eq4[0] = '0' + a,eq4[1] = '?',eq4[2] = '(',eq4[3] = '0' + b,eq4[4] = '?',eq4[5] = '(',eq4[6] = '0' + c,eq4[7] = '?',eq4[8] = '0' + d,eq4[9] = ')',eq4[10] = ')',eq4[11] = '\0';
	eq5[0] = '(',eq5[1] = '0' + a,eq5[2] = '?',eq5[3] = '(',eq5[4] = '0' + b,eq5[5] = '?',eq5[6] = '0' + c,eq5[7] = ')',eq5[8] = ')',eq5[9] = '?',eq5[10] = '0' + d,eq5[11] = '\0';
	eq6[0] = '(',eq6[1] = '0' + a,eq6[2] = '?',eq6[3] = '0' + b,eq6[4] = ')',eq6[5] = '?',eq6[6] = '0' + c,eq6[7] = '?',eq6[8] = '0' + d,eq6[9] = '\0';
	eq7[0] = '(',eq7[1] = '(',eq7[2] = '0' + a,eq7[3] = '?',eq7[4] = '0' + b,eq7[5] = ')',eq7[6] = '?',eq7[7] = '0' + c,eq7[8] = ')',eq7[9] = '?',eq7[10] = '0' + d,eq7[11] = '\0';
	eq8[0] = '0' + a,eq8[1] = '?',eq8[2] = '(',eq8[3] = '(',eq8[4] = '0' + b,eq8[5] = '?',eq8[6] = '0' + c,eq8[7] = ')',eq8[8] = '?',eq8[9] = '0' + d,eq8[10] = ')',eq8[11] = '\0';


	for(int x = 0; x < 3; x++){
		for(int y = 0; y < 3; y++){
			for(int z = 0; z < 3; z++){
				switch(x){
				case 0:
					eq1[2] = '+',eq2[1] = '+',eq3[1] = '+',eq4[1] = '+',eq5[2] = '+',eq6[2] = '+',eq7[3] = '+',eq8[1] = '+';
					break;
				case 1:
					eq1[2] = '-',eq2[1] = '-',eq3[1] = '-',eq4[1] = '-',eq5[2] = '-',eq6[2] = '-',eq7[3] = '-',eq8[1] = '-';
					break;
				case 2:
					eq1[2] = '*',eq2[1] = '*',eq3[1] = '*',eq4[1] = '*',eq5[2] = '*',eq6[2] = '*',eq7[3] = '*',eq8[1] = '*';
					break;
				}
				switch(y){
				case 0:
					eq1[5] = '+',eq2[4] = '+',eq3[3] = '+',eq4[4] = '+',eq5[5] = '+',eq6[5] = '+',eq7[6] = '+',eq8[5] = '+';
					break;
				case 1:
					eq1[5] = '-',eq2[4] = '-',eq3[3] = '-',eq4[4] = '-',eq5[5] = '-',eq6[5] = '-',eq7[6] = '-',eq8[5] = '-';
					break;
				case 2:
					eq1[5] = '*',eq2[4] = '*',eq3[3] = '*',eq4[4] = '*',eq5[5] = '*',eq6[5] = '*',eq7[6] = '*',eq8[5] = '*';
					break;
				}
				switch(z){
				case 0:
					eq1[8] = '+',eq2[7] = '+',eq3[6] = '+',eq4[7] = '+',eq5[9] = '+',eq6[7] = '+',eq7[9] = '+',eq8[8] = '+';
					break;
				case 1:
					eq1[8] = '-',eq2[7] = '-',eq3[6] = '-',eq4[7] = '-',eq5[9] = '-',eq6[7] = '-',eq7[9] = '-',eq8[8] = '-';
					break;
				case 2:
					eq1[8] = '*',eq2[7] = '*',eq3[6] = '*',eq4[7] = '*',eq5[9] = '*',eq6[7] = '*',eq7[9] = '*',eq8[8] = '*';
					break;
				}
				if(calc(eq1) == 10){
					for(int i = 0; i < 30; i++)ans[i] = eq1[i];
					Found = true;
				}
				if(calc(eq2) == 10){
					for(int i = 0; i < 30; i++)ans[i] = eq2[i];
					Found = true;
				}
				if(calc(eq3) == 10){
					for(int i = 0; i < 30; i++)ans[i] = eq3[i];
					Found = true;
				}
				if(calc(eq4) == 10){
					for(int i = 0; i < 30; i++)ans[i] = eq4[i];
					Found = true;
				}
				if(calc(eq5) == 10){
					for(int i = 0; i < 30; i++)ans[i] = eq5[i];
					Found = true;
				}
				if(calc(eq6) == 10){
					for(int i = 0; i < 30; i++)ans[i] = eq6[i];
					Found = true;
				}
				if(calc(eq7) == 10){
					for(int i = 0; i < 30; i++)ans[i] = eq7[i];
					Found = true;
				}
				if(calc(eq8) == 10){
					for(int i = 0; i < 30; i++)ans[i] = eq8[i];
					Found = true;
				}
			}
		}
	}
}


int main(){

	int a,b,c,d,num[4];

	while(true){
		scanf("%d %d %d %d",&a,&b,&c,&d);
		if(a == 0 && b == 0 && c == 0 && d == 0)break;

		Found = false;

		num[0] = a,num[1] = b,num[2] = c,num[3] =d;

		for(int e = 0; e < 4; e++){
			for(int f = 0; f < 4; f++){
				for(int g = 0; g < 4; g++){
					for(int h = 0; h < 4; h++){
						if(e != f && e != g && e != h && f != g && f != h && g != h)func(num[e],num[f],num[g],num[h]);
						if(Found)break;
					}
					if(Found)break;
				}
				if(Found)break;
			}
			if(Found)break;
		}

		if(Found)printf("%s\n",ans);
		else{
			printf("0\n");
		}
	}



	return 0;
}