Problem: Using the given four integers from 1 to 9, we create an expression that gives an answer of 10. When you enter four integers a, b, c, d, write a program that outputs an expression that gives an answer of 10 according to the following conditions. Also, if there are multiple answers, only the first answer found will be output. If there is no answer, output 0.

* Use only addition (+), subtraction (-), and multiplication (*) as operators. Do not use division (/). You can use three operators.
* You must use all four numbers.
* You can freely change the order of the four numbers.
* You can use parentheses. You can use up to 3 sets (6) of parentheses.



Input

Given multiple datasets. The format of each dataset is as follows:


a b c d

Input ends with four 0s. The number of datasets does not exceed 40.

Output

For each dataset, combine the given four integers with the above arithmetic symbols and parentheses to output an expression or 0 with a value of 10 on one line. The expression string must not exceed 1024 characters.

Example

Input

8 7 9 9
4 4 4 4
5 5 7 5
0 0 0 0


Output

((9 * (9 - 7)) - 8)
0
((7 * 5) - (5 * 5))

Solution (in CPP):

Solution:
//============================================================================
// Name        : aoj0041.cpp
// Author      : afterCmidday
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#define MAX_NUM 4

const char mark[MAX_NUM] = "+-*";
int val[MAX_NUM];
int end;
char ans[4096];

int calculateRP(char *str){
    int stack[MAX_NUM], sp = 0;
    char *cp;
    for(cp = str;*cp != '\0';cp++){
    	if(isalpha(*cp)){
            stack[sp++] = val[*cp - 'a'];
        }else if(*cp == '+'){
        	stack[sp - 2] += stack[sp - 1];
        	sp--;
        }else if(*cp == '-'){
        	stack[sp - 2] -= stack[sp - 1];
        	sp--;
        }else if(*cp == '*'){
            stack[sp - 2] *= stack[sp - 1];
            sp--;
        }
    }
    return stack[0];
}

void createNormalFormula(char *hp,char *rhp){
	char *cp, *rcp;
	for(cp = hp,rcp = rhp;*cp != '\0';cp++){
		*rcp = '\0';
		if(isalpha(*cp) || *cp == ' '){
			*rcp = *cp;
			rcp++;
		}else{
			int flag = 0;
			char *rtmp, *ltmp, *tmp;
			for(rtmp = rcp - 1;;rtmp--){
				if(*rtmp == '('){
					flag--;
				}else if(*rtmp == ')'){
					flag++;
				}
				if(flag == 0 && (*rtmp == '(' || isalpha(*rtmp))){
					break;
				}
			}
			for(ltmp = rtmp - 1;;ltmp--){
				if(*ltmp == '('){
					flag--;
				}else if(*ltmp == ')'){
					flag++;
				}
				if(flag == 0 && (*ltmp == '(' || isalpha(*ltmp))){
					break;
				}
			}
			for(tmp = rcp;tmp > ltmp;tmp--){
				*tmp = *(tmp - 1);
			}
			*ltmp = '(';
			*rcp = ')';
			rcp++;
			rtmp++;
			for(tmp = rcp;tmp > rtmp;tmp--){
				*(tmp + 1) = *(tmp - 1);
			}
			*rtmp = *cp;
			*(rtmp + 1) = ' ';
			rcp += 2;
		}
	}
	*rcp = '\0';
}

void createRPFormula(int vn,int mn,char *hp,char *cp){
    int i;
    static int flag[MAX_NUM] = {0};
    if(vn - 1 == mn && vn == MAX_NUM){
        *(cp - 1) = '\0';
        if(calculateRP(hp) == 10){
        	 char str[4096] = "";
        	 createNormalFormula(hp,str);
        	 strcpy(ans,str);
        	 end = 1;
        	 return;
        }

    }
    if(vn - mn > 1){
        for(i = 0;i < 3;i++){
            *cp = mark[i];
            *(cp + 1) = ' ';
             createRPFormula(vn,mn + 1,hp,cp + 2);
             if(end){
            	 return;
             }
        }
    }
    for(i = 0;i < MAX_NUM;i++){
        if(flag[i] == 0){
            flag[i] = 1;
            *cp = 'a' + i;
            *(cp + 1) = ' ';
             createRPFormula(vn + 1,mn,hp,cp + 2);
            flag[i] = 0;
            if(end){
            	return;
            }
        }
    }
}



int main(void){
    int i;
    char str[4096];
    while(1){
    	for(i = 0;i < MAX_NUM;i++){
    		scanf("%d",&val[i]);
    	}
    	for(i = 0;i < MAX_NUM;i++){
    		if(val[i] != 0){
    			break;
    		}
    	}
    	if(i == MAX_NUM){
    		break;
    	}
    	end = 0;
    	strcpy(ans,"0");
    	createRPFormula(0,0,str,str);
    	for(i = 0;i < strlen(ans);i++){
    		if(isalpha(ans[i])){
    			printf("%d",val[ans[i] - 'a']);
    		}else{
    			printf("%c",ans[i]);
    		}
    	}
    	printf("\n");
    }
    return 0;
}