#include <stdio.h>

#define OVER -1000

char op[4] = { '+', '-', '*', '/' };

int cal(int a, int b, int o){
	int r = 0;
	switch(o){
	case 0:
		r = a + b;
		break;
	case 1:
		r = a - b;
		break;
	case 2:
		r = a * b;
		break;
	case 3:
		if(b!=0 && a%b==0){
			r = a / b;
		}else{
			r = OVER;
		}
		break;
	default:
		break;
	}
	return r;
}

void c31(const int a[], char *dest){
	dest[0] = '0';
	int sum = 0;
	int tmp = 0;
	for(int i=0; i<4; ++i){
		if(a[1] == OVER){ continue; }
		sum = cal(a[0], a[1], i);
		for(int j=0; j<4; ++j){
			if(a[2] == OVER){ continue; }
			tmp = sum;
			sum = cal(sum, a[2], j);
			for(int k=0; k<4; ++k){
				if(a[3] == OVER){ continue; }
				if(cal(sum, a[3], k) == 10){
					sprintf(dest, "((%d%c%d)%c%d)%c%d",
						a[0], op[i], a[1], op[j], a[2], op[k], a[3]);
					return;
				}
			}
			sum = tmp;
		}
	}
}

void c22(const int a[], char *dest){
	char find = '\0';
	dest[0] = '0';
	int map1[4] = {
		cal(a[0], a[1], 0),
		cal(a[0], a[1], 1),
		cal(a[0], a[1], 2),
		cal(a[0], a[1], 3),
	};
	int map2[4] = {
		cal(a[2], a[3], 0),
		cal(a[2], a[3], 1),
		cal(a[2], a[3], 2),
		cal(a[2], a[3], 3),
	};
	for(int i=0; i<4; ++i){
		if(map1[i] == OVER){ continue; }
		for(int j=0; j<4; ++j){
			if(map2[j] == OVER){ continue; }
			for(int k=0; k<4; ++k){
				if(cal(map1[i], map2[j], k) == 10){
					find = op[k];
					break;
				}
			}
			if(find != '\0'){
				sprintf(dest, "(%d%c%d)%c(%d%c%d)",
					a[0], op[i], a[1], find, a[2], op[j], a[3]);
				return;
			}
		}
	}
}

int main(void){
	int a[4];
	char dest[30] = "";
	while(true){
		dest[0] = '0';
		dest[1] = '\0';
		scanf("%d %d %d %d", a, a+1, a+2, a+3);
		if(a[0] + a[1] + a[2] + a[3] == 0){ break; }
		int p[24][4] = {
			{ a[0], a[1], a[2], a[3] },
			{ a[0], a[1], a[3], a[2] },
			{ a[0], a[2], a[1], a[3] },
			{ a[0], a[2], a[3], a[1] },
			{ a[0], a[3], a[1], a[2] },
			{ a[0], a[3], a[2], a[1] },
			{ a[1], a[0], a[2], a[3] },
			{ a[1], a[0], a[3], a[2] },
			{ a[1], a[2], a[0], a[3] },
			{ a[1], a[2], a[3], a[0] },
			{ a[1], a[3], a[0], a[2] },
			{ a[1], a[3], a[2], a[0] },
			{ a[2], a[0], a[1], a[3] },
			{ a[2], a[0], a[3], a[1] },
			{ a[2], a[1], a[0], a[3] },
			{ a[2], a[1], a[3], a[0] },
			{ a[2], a[3], a[1], a[0] },
			{ a[2], a[3], a[0], a[1] },
			{ a[3], a[1], a[2], a[3] },
			{ a[3], a[1], a[0], a[2] },
			{ a[3], a[2], a[1], a[0] },
			{ a[3], a[2], a[0], a[1] },
			{ a[3], a[0], a[1], a[2] },
			{ a[3], a[0], a[2], a[1] },
		};
		for(int i=0; i<24; i++){
			c22(p[i], dest);
			if(dest[0] != '0'){ break; }
			c31(p[i], dest);
			if(dest[0] != '0'){ break; }
		}
		puts(dest);
	}
	return 0;
}