Operand =  ['+', '-', '*']

def calc(v1, v2, oprnd)
  case oprnd
    when '+'
      return v1 + v2
    when '-'
      return v1 - v2
    else
      return v1 * v2
  end
end

def getNewArray
  array = Array.new
  $stdin.gets.chomp.split(" ").each{|s| array << s.to_i }
  return array
end

def solve(perm, target)
  perm.each{|v|
    Operand.each{|o1|
      sum1 = calc(v[0], v[1], o1)
      Operand.each{|o2|
        sum2a = calc(sum1, v[2], o2)
        sum2b = calc(v[2], v[3], o2)
        Operand.each{|o3|
          sum3a = calc(sum2a, v[3], o3)
          sum3b = calc(sum1, sum2b, o3)
          if sum3a == target
            return "(((" + v[0].to_s + " " + o1 + " " + v[1].to_s + ")" + " " + o2 + " " + v[2].to_s + ")" + " " + o3 + " " + v[3].to_s + ")"
          end
          if sum3b == target
            return "((" + v[0].to_s + " " + o1 + " " + v[1].to_s + ")" + " " + o3 + " " + "(" + v[2].to_s + " " + o2 + " " + v[3].to_s + "))"
          end
        }
      }
    }
  }
  return 0
end

loop do
  array = getNewArray
  break if 0 == array.inject(:+)
  puts solve(array.permutation(4).to_a, 10)
end