import scala.io.StdIn.readLine

object Main {
  def calc(c:Char,a:Int,b:Int) = c match { case '+' => a+b;case '-'=> a-b;case '*'=>a*b }
  def loop2(a:Int,b:Int,c:Int,d:Int,ops:List[List[Char]]):Boolean = ops match {
    case Nil => false
    case op::tl =>
      if(calc(op(2),calc(op(1),calc(op(0),a,b),c),d)==10) {
        printf("(((%d %c %d) %c %d) %c %d)\n",a,op(0),b,op(1),c,op(2),d);true
      }
      else if(calc(op(1),calc(op(0),a,b),calc(op(2),c,d))==10) {
        printf("((%d %c %d) %c (%d %c %d))\n",a,op(0),b,op(1),c,op(2),d);true
      } else loop2(a,b,c,d,tl)
  }

  def loop(l:Iterator[Array[Int]],ops:List[List[Char]]):Unit = {
    if(l.isEmpty) println(0)
    else {
      val Array(a,b,c,d):Array[Int] = l.next
      if(loop2(a,b,c,d,ops)) return
      else loop(l,ops)
    }
  }

  def main(args:Array[String]) = {
    Iterator.continually(readLine).takeWhile ( s => s != "0 0 0 0").foreach { s =>
      val l = s.split(" ").map(_.toInt).permutations
      val op = List('+','-','*')
      val ops = { for(i<-op;j<-op;k<-op) yield List(i,j,k) }.toList
      loop(l,ops)
    }
  }
}