#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
 
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<stdarg.h>
#include<malloc.h>
#include<limits.h>

int calc(int a, int b, int x);
int perm(int p[4], int);

int judge(int p[4]);

int main()
{
	int p[4];

	while(1){

		scanf("%d%d%d%d", &p[0], &p[1], &p[2], &p[3]);
		if(p[0] == 0)
			break;

		if(!judge(p))
			printf("0\n");

	}

	return 0;
}

int perm(int p[4], int n)
{
	int buf;
	switch(n){
		case 1:
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 2:
			buf = p[1], p[1] = p[3], p[3] = buf;
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 3:
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 4:
			buf = p[1], p[1] = p[2], p[2] = buf;
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 5:
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 6:
			buf = p[0], p[0] = p[3], p[3] = buf;
			buf = p[1], p[1] = p[3], p[3] = buf;
			break;
		case 7:
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 8:
			buf = p[1], p[1] = p[3], p[3] = buf;
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 9:
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 10:
			buf = p[1], p[1] = p[2], p[2] = buf;
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 11:
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 12:
			buf = p[0], p[0] = p[2], p[2] = buf;
			buf = p[1], p[1] = p[3], p[3] = buf;
			break;
		case 13:
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 14:
			buf = p[1], p[1] = p[3], p[3] = buf;
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 15:
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 16:
			buf = p[1], p[1] = p[2], p[2] = buf;
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 17:
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 18:
			buf = p[0], p[0] = p[1], p[1] = buf;
			buf = p[1], p[1] = p[3], p[3] = buf;
			break;
		case 19:
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 20:
			buf = p[1], p[1] = p[3], p[3] = buf;
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 21:
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 22:
			buf = p[1], p[1] = p[2], p[2] = buf;
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 23:
			buf = p[2], p[2] = p[3], p[3] = buf;
			break;
		case 24:
			break;
	}

	if(n==24)
		return 0;
	return 1;
}

int judge(int p[4])
{
	int i, j, k, n;
	int q[3];
	char o[3] = {'+', '-', '*'};

	n = 0;

	do{

		for(i=0; i<3; i++){
		for(j=0; j<3; j++){			// ((a i b) j c) k d
		for(k=0; k<3; k++){
			q[0] = calc(p[0], p[1], i);
			q[1] = calc(q[0], p[2], j);
			q[2] = calc(q[1], p[3], k);

			if(q[2] == 10){
				printf("((%d %c %d) %c %d) %c %d\n",p[0],o[i],p[1],o[j],p[2],o[k],p[3]);
				return 1;
			}
		}}}

		for(i=0; i<3; i++){
		for(j=0; j<3; j++){			// (a i b) k (c j d)
		for(k=0; k<3; k++){
			q[0] = calc(p[0], p[1], i);
			q[1] = calc(p[2], p[3], j);
			q[2] = calc(q[0], q[1], k);

			if(q[2] == 10){
				printf("(%d %c %d) %c (%d %c %d)\n",p[0],o[i],p[1],o[k],p[2],o[j],p[3]);
				return 1;
			}
		}}}

		for(i=0; i<3; i++){
		for(j=0; j<3; j++){			// (a j (b i c)) k d
		for(k=0; k<3; k++){
			q[0] = calc(p[1], p[2], i);
			q[1] = calc(p[0], q[0], j);
			q[2] = calc(q[1], p[3], k);

			if(q[2] == 10){
				printf("(%d %c (%d %c %d)) %c %d\n",p[0],o[j],p[1],o[i],p[2],o[k],p[3]);
				return 1;
			}
		}}}

		for(i=0; i<3; i++){
		for(j=0; j<3; j++){			// a k ((b i c) j d)
		for(k=0; k<3; k++){
			q[0] = calc(p[1], p[2], i);
			q[1] = calc(q[0], p[3], j);
			q[2] = calc(p[0], q[1], k);

			if(q[2] == 10){
				printf("%d %c ((%d %c %d) %c %d)\n",p[0],o[k],p[1],o[i],p[2],o[j],p[3]);
				return 1;
			}
		}}}

		for(i=0; i<3; i++){
		for(j=0; j<3; j++){			// a k (b j (c i d))
		for(k=0; k<3; k++){
			q[0] = calc(p[2], p[3], i);
			q[1] = calc(p[1], q[0], j);
			q[2] = calc(p[0], q[1], k);

			if(q[2] == 10){
				printf("%d %c (%d %c (%d %c %d))\n",p[0],o[k],p[1],o[j],p[2],o[i],p[3]);
				return 1;
			}
		}}}

		n++;

	}while(perm(p, n));

	return 0;
}


int calc(int a, int b, int x){
	if(x==0)
		return a+b;
	if(x==1)
		return a-b;
	return a*b;
}

Measured memory_bytes: 612