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 JAVA):

Solution:
import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	public static int[] input = new int[4];
	public static String ss = null;
	public static int ptr = 0;
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		doIt();
		//test();

	}
	
	public static void test(){
		String s = String.format("%d%d%c%d%d%c%c", 7,5,'*',5,5,'*','-');
		System.out.println(s);
		int ret = analyze(s);;
		System.out.println("s = " + s + ", ret = " + ret);
	}

	public static void doIt(){
		Scanner sc = new Scanner(System.in);
		for(int i = 0; i < 4; i++){
			input[i] = sc.nextInt();
		}
		while(input[0] != 0){
			String ans = searchAll();
			if(ans == null){
				System.out.println(0);
			}
			else{
				ans = decode(ans);
				System.out.println(ans);
			}
			for(int i = 0; i < 4; i++){
				input[i] = sc.nextInt();
			}
		}
	}

	public static String searchAll(){
		//後置ポーランド記法で全パターン試す
		//"nn#n#n#", "nn#nn##", "nnn##n#", "nnn#n##", "nnnn###"(n:値 #:演算子)
		String ans = null;
		int[] num = new int[4];
		char[] operator = {'+', '-', '*'};
		char[] op = new char[3];
		for(int i = 0; i < 4; i++){
			num[0] = input[i];
			input[i] = 0;
			for(int j = 0; j < 4; j++){
				if(input[j] == 0){
					continue;
				}
				num[1] = input[j];
				input[j] = 0;
				for(int k = 0; k < 4; k++){
					if(input[k] == 0){
						continue;
					}
					num[2] = input[k];
					input[k] = 0;
					for(int l = 0; l < 4; l++){
						if(input[l] == 0){
							continue;
						}
						num[3] = input[l];
						input[l] = 0;
						for(int m = 0; m < 3; m++){
							op[0] = operator[m];
							for(int n = 0; n < 3; n++){
								op[1] = operator[n];
								for(int o = 0; o < 3; o++){
									op[2] = operator[o];
									//"nn#n#n#"
									String s = String.format("%d%d%c%d%c%d%c", num[0],num[1],op[0],num[2],op[1],num[3],op[2]);
									int ret = analyze(s);
									if(ret == 10){
										return s;
									}
									//"nn#nn##"
									s = String.format("%d%d%c%d%d%c%c", num[0],num[1],op[0],num[2],num[3],op[1],op[2]);
									ret = analyze(s);
									if(ret == 10){
										return s;
									}
									//"nnn##n#"
									s = String.format("%d%d%d%c%c%d%c", num[0],num[1],num[2],op[0],op[1],num[3],op[2]);
									ret = analyze(s);
									if(ret == 10){
										return s;
									}
									//"nnn#n##"
									s = String.format("%d%d%d%c%d%c%c", num[0],num[1],num[2],op[0],num[3],op[1],op[2]);
									ret = analyze(s);
									if(ret == 10){
										return s;
									}
									//"nnnn###"
									s = String.format("%d%d%d%d%c%c%c", num[0],num[1],num[2],num[3],op[0],op[1],op[2]);
									ret = analyze(s);
									if(ret == 10){
										return s;
									}
								}
							}
						}
						input[l] = num[3];
					}
					input[k] = num[2];
				}
				input[j] = num[1];
			}
			input[i] = num[0];
		}
		return ans;
	}
	
	public static String decode(String s){
		ss = s;
		//多分6のはず
		ptr = s.length() - 1;
		return _getNext();
	}
	//sを後ろからptrで解析
	public static String _getNext(){
		String ret = null, left = null, right = null;
		char c = ss.charAt(ptr--);
		if(c == '+'){
			right = _getNext();
			left = _getNext();
			ret = "(" + left + " + " + right + ")";
		}
		else if(c == '-'){
			right = _getNext();
			left = _getNext();
			ret = "(" + left + " - " + right + ")";
		}
		else if(c == '*'){
			right = _getNext();
			left = _getNext();
			ret = "(" + left + " * " + right + ")";
		}
		else{
			//数字のはず
			ret = String.valueOf(c);
		}
		return ret;
	}
	
	public static int analyze(String s){
		ss = s;
		//多分6のはず
		ptr = s.length() - 1;
		return getNext();
	}
	//sを後ろからptrで解析
	public static int getNext(){
		int ret = 0, left = 0, right = 0;
		char c = ss.charAt(ptr--);
		if(c == '+'){
			right = getNext();
			left = getNext();
			ret = left + right;
		}
		else if(c == '-'){
			right = getNext();
			left = getNext();
			ret = left - right;
		}
		else if(c == '*'){
			right = getNext();
			left = getNext();
			ret = left * right;
		}
		else{
			//数字のはず
			ret = Character.getNumericValue(c);
		}
		return ret;
	}
}