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.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.LinkedList;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));
		for (String str; ! (str = br.readLine()).equals("0 0 0 0"); ) {
			String[] data = str.split(" ");
			String ans = solve(data[0], data[1], data[2], data[3]);
			System.out.println(ans);
		}
	}

	public static String solve(String a, String b, String c, String d) {
		LinkedList<Term> a_b_c_d = new LinkedList<>();
		a_b_c_d.add(new Term(a));
		a_b_c_d.add(new Term(b));
		a_b_c_d.add(new Term(c));
		a_b_c_d.add(new Term(d));

		HashSet< LinkedList<Term> > before = new HashSet<>();
		HashSet< LinkedList<Term> > after = new HashSet<>();

		before.add(a_b_c_d);
		for (int i=0; i < 3; i++) {
			for( LinkedList<Term> e : before) {
				LinkedList<Term> copy = new LinkedList<>(e);
				HashSet< LinkedList<Term> > temp = calc(copy);
				after.addAll(new HashSet<LinkedList<Term>>(temp));
			}
			before = after;
			after = new HashSet<>();
		}

		for (LinkedList<Term> e : before) {
			if (e.getFirst().num == 10) {
				return e.getFirst().expression;
			}
		}
		return "0";
	}

	/*
	 * ????????????????????????????????????????????????????????????
	 * ????????????????????§ +, *, - ???????????\?????°????????????
	 * ????????????????????????????????£???????????????????????\???????????\?????°???????????????
	 * ??????????????????????????¨????????????????????????????????¨???????????????????????§?????\?????¶?????????
	 * ??°??????????????????????????°??????????????????????????????
	 */
	public static HashSet< LinkedList<Term> > calc(LinkedList<Term> termlist) {
		HashSet< LinkedList<Term> > ret = new HashSet<>();
		for (int i=0; i < termlist.size(); i++) {
			for (int j=i+1; j < termlist.size(); j++) {
				LinkedList<Term> templist = new LinkedList<>();
				for (int k=0; k < termlist.size(); k++) {
					if (k != i && k != j) {
						templist.add(new Term(termlist.get(k)));
					}
				}

				Term temp = termlist.get(i).plus( termlist.get(j) );
				LinkedList<Term> list_i_plus_j = new LinkedList<>(templist);
				list_i_plus_j.add(temp);
				ret.add(list_i_plus_j);

				temp = termlist.get(i).multiple( termlist.get(j) );
				LinkedList<Term> list_i_multiple_j = new LinkedList<>(templist);
				list_i_multiple_j.add(temp);
				ret.add(list_i_multiple_j);

				temp = termlist.get(i).minus( termlist.get(j) );
				LinkedList<Term> list_i_minus_j = new LinkedList<>(templist);
				list_i_minus_j.add(temp);
				ret.add(list_i_minus_j);

				if (  termlist.get(i).num == termlist.get(j).num  ) continue;

				temp = termlist.get(j).minus( termlist.get(i) );
				LinkedList<Term> list_j_minus_i = new LinkedList<>(templist);
				list_j_minus_i.add(temp);
				ret.add(list_j_minus_i);
			}
		}
		return ret;
	}

	public static class Term {
		public int num;
		public String expression;

		public Term(String num) {
			this.num = Integer.parseInt(num);
			this.expression = num;
		}

		private Term(int num, String expression) {
			this.num = num;
			this.expression = expression;
		}

		public Term(Term t) {
			this.num = t.num;
			this.expression = t.expression;
		}

		public Term plus(Term t) {
			int retnum;
			retnum = this.num + t.num;
			String retstr;
			retstr = "(" + this.expression + " + " + t.expression + ")";
			return new Term(retnum, retstr);
		}

		public Term minus(Term t) {
			int retnum;
			retnum = this.num - t.num;
			String retstr;
			retstr = "(" + this.expression + " - " + t.expression + ")";
			return new Term(retnum, retstr);
		}

		public Term multiple(Term t) {
			int retnum;
			retnum = this.num * t.num;
			String retstr;
			retstr = "(" + this.expression + " * " + t.expression + ")";
			return new Term(retnum, retstr);
		}

		public boolean equals(Term t) {
			if (this.num == t.num) return true;
			else return false;
		}
//		@Override
//		public int hashCode() {
//			final int prime = 31;
//			int result = 1;
//			result = prime * result + num;
//			return result;
//		}
//
//		@Override
//		public boolean equals(Object obj) {
//			if (this == obj)
//				return true;
//			if (obj == null)
//				return false;
//			if (getClass() != obj.getClass())
//				return false;
//			Term other = (Term) obj;
//			if (num != other.num)
//				return false;
//			return true;
//		}
	}
}