Exp = ["+", "-", "*"]
def solve(num)
  num.permutation(4).each do |a, c, e, g| 
    Exp.repeated_permutation(3).each do |b, d, f|
      ks = "("; ke = ")"
      [ks + a + b + c + ke + d + ks + e + f + g + ke,
       ks + a + b + ks + c + d + e + ke + ke + f + g,
       a + b + ks + ks + c + d + e + ke + f + g + ke,
       ks + ks + a + b + c + ke + d + e + ke + f + g,
       a + b + ks + c + d + ks + e + f + g + ke + ke].each do |form|
         return form if eval(form) == 10
      end
    end
  end
  nil
end
loop do
  num = gets.split
  break if num[0] == "0"
  res = solve(num)
  puts res ? res : 0
end