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

const int IntMax = 2147483647;
int in[4], n[4], ope[3], pri[3];
bool memo[3] = {};

int cal_pair(int a, int b, int sw){
	if (sw == 0) return a + b;
	else if (sw == 1) return a - b;
	else return a*b;
}

int abso(int n){
	if (n < 0) n *= -1;
	return n;
}

int cal(int o){
	int a, b, mini = 3, next;
	bool flag = false;
	for (int i = o - 1; i >= 0 ; i--){
		if (pri[o] <= pri[i] && mini > pri[i] && !memo[i]){
			mini = pri[i];
			next = i;
			flag = true;
		}
	}
	if (flag){
		a = cal(next);
		memo[next] = true;
		//printf("*");
	}
	else{
		a = n[o];
	}
	//printf("%d ", a);
	mini = 3; flag = false;
	for (int i = o + 1; i < 3; i++){
		if (pri[o] < pri[i] && mini >= pri[i] && !memo[i]){
			mini = pri[i];
			next = i;
			flag = true;
		}
	}
	if (flag){
		b = cal(next);
		memo[next] = true;
		//printf("*");
	}
	else{
		b = n[o + 1];
	}
	//printf("%d\n", b);
	return cal_pair(a, b, ope[o]);
}

int main(){
	int ans;
	/*for (int i = 0; i < 4; i++){
		cin >> n[i];
	}
	for (int i = 0; i < 3; i++){
		cin >> ope[i];
	}
	for (int i = 0; i < 3; i++){
		cin >> pri[i];
	}
	for (int i = 0; i < 3; i++) cal_r[i] = IntMax;
	for (int i = 0; i < 3; i++){
		for (int j = 2; j >= 0; j--){
			if (pri[j] == i){
				ans = cal(j);
				printf("ans = %d\n", ans);
				goto END;
			}
		}
	}
	END:
	printf("%d\n", ans);*/

	while (1){
		for (int i = 0; i < 4; i++){
			cin >> in[i];
		}
		if (in[0] == 0 && in[1] == 0 && in[2] == 0 && in[3] == 0) return 0;
		for (int ni = 0; ni < 4; ni++){
			n[0] = in[ni];
			for (int nj = 0; nj < 4; nj++){
				if (ni == nj) continue;
				n[1] = in[nj];
				for (int nk = 0; nk < 4; nk++){
					if (ni == nk || nj == nk) continue;
					n[2] = in[nk];
					for (int nl = 0; nl < 4; nl++){
						if (ni == nl || nj == nl || nk == nl) continue;
						n[3] = in[nl];
						for (int oi = 0; oi < 3; oi++){
							ope[0] = oi;
							for (int oj = 0; oj < 3; oj++){
								ope[1] = oj;
								for (int ok = 0; ok < 3; ok++){
									ope[2] = ok;
									for (int prii = 0; prii < 3; prii++){
										pri[0] = prii;
										for (int prij = 0; prij < 3; prij++){
											pri[1] = prij;
											for (int prik = 0; prik < 3; prik++){
												pri[2] = prik;

												bool pri_cnt[3] = {}, flag = false;
												bool pri_memo[3][3][3] = {};
												int pare = 0;
												for (int i = 1; i < 3; i++){
													if (pri[i] == pri[i - 1]) flag = true;
													if (abso(pri[i] - pri[i - 1]) >= 2) flag = true;
												}
												if (flag) continue;

												for (int i = 0; i < 3; i++) memo[i] = false;
												for (int i = 0; i < 3; i++){
													for (int j = 0; j < 3; j++){
														pri_cnt[pri[i]] = true;
													}
												}
												for (int i = 2; i >= 0; i--){
													if (!pri_cnt[i]){
														for (int j = 0; j < 3; j++){
															if (pri[j] > i){
																pri[j]--;
															}
														}
													}
												}
												if (pri_memo[pri[0]][pri[1]][pri[2]]) continue;
												pri_memo[pri[0]][pri[1]][pri[2]] = true;

												/*//if (pri[0] == 1 && pri[1] == 2 && pri[2] == 0){
													for (int i = 0; i < 4; i++){
													printf("%d ", n[i]);
													} printf(" ");
													for (int i = 0; i < 3; i++){
													printf("%d ", ope[i]);
													} printf(" ");
													for (int i = 0; i < 3; i++){
													printf("%d ", pri[i]);
													} //printf("\n");
													//}*/
												for (int i = 0; i < 3; i++){
													for (int j = 2; j >= 0; j--){
														if (pri[j] == i){
															ans = cal(j);
															//printf("  %d\n", ans);
															goto OUTPUT;
														}
													}
												}
											OUTPUT:
												if (ans == 10){
													int pri_c;
													printf("(");
													for (int i = 0; i < 4; i++){
														pri_c = pri[i];
														if (i < 3 && pare < pri_c){
															for (int j = pare; j < pri_c; j++){
																pare++;
																printf("(");
															}
														}
														printf("%d", n[i]);
														if (i > 0){
															if (i == 3) pri_c = 0;
															else pri_c = pri[i];
															if (pare > pri_c){
																for (int j = pare; j > pri_c; j--){
																	pare--;
																	printf(")");
																}
															}
														}
														if (i < 3){
															if (ope[i] == 0) printf(" + ");
															else if (ope[i] == 1) printf(" - ");
															else if (ope[i] == 2) printf(" * ");
														}
													}
													puts(")");
													goto NEXT;
												}
												/*if (ans == 10){
													for (int i = 0; i < 4; i++){
													printf("%d ", n[i]);
													} puts("");
													for (int i = 0; i < 3; i++){
													printf("%d ", ope[i]);
													} puts("");
													for (int i = 0; i < 3; i++){
													printf("%d ", pri[i]);
													}puts("");
													return 0;
													}*/

											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
		printf("0\n");
		NEXT:;
	}
	return 0;
}