Ope = [:+, :-, :*]
def tos(fo, op, la)
  return "(#{fo} #{op} #{la})"
end
while (arg = gets.split(" ").map(&:to_i)) != [0,0,0,0]
  result = []
  arg.permutation(4){|a, b, c, d|
    for i in Ope
      for j in Ope
        for k in Ope
          if a.send(i, b.send(j, c.send(k, d))) == 10
            result << tos(a, i, tos(b, j, tos(c, k, d)))
          end
          if a.send(i, b).send(j, c.send(k, d)) == 10
            result << tos(tos(a, i, b), j, tos(c, k, d))
          end
          if a.send(i, b.send(j, c)).send(k, d) == 10
            result << tos(tos(a, i, tos(b, j, c)), k, d)
          end
        end
      end
    end
  }
  if result.length != 0
    puts result[0]
  else
    puts 0
  end
end