op = ["+","-","*"]
p = op.product(op,op)

def convp(p, mode)
  st = []
  while p.size > 0
    x = p.shift
    if mode == 0
      case x
      when "+"
        st.push(st.pop+st.pop)
      when "-"
        st.push(-st.pop+st.pop)
      when "*"
        st.push(st.pop*st.pop)
      else #numeric
        st << x
      end
    else
      if x.to_s =~ /[1-9]/
        st.push(x.to_s)
      else
        a,b=st.pop,st.pop
        (x == "*" and b.size != 1) ? st.push("("+b+")"+" "+x+" "+a) : st.push(b+" "+x+" "+a)
      end
    end
  end
  return st
end

loop do
  e,f,g,h = gets.split.map(&:to_i)
  break if e+f+g+h==0
  catch(:exit) do
    [e,f,g,h].permutation(4) do |a,b,c,d|
      p.each do |l|
        ln = Array.new(5){[a,b]}
        5.times do |idx|
          case idx
          when 0
            [ln[0],ln[1],ln[2]].each{|x| x << c}
            [ln[3],ln[4]].each{|x| x << l[0]}
          when 1
            ln[0] << d
            [ln[1],ln[2]].each{|x| x << l[0]}
            [ln[3],ln[4]].each{|x| x << c}
          when 2
            ln[0] << l[0]
            [ln[1],ln[4]].each{|x| x << d}
            [ln[2],ln[3]].each{|x| x << l[1]}
          when 3
            [ln[0],ln[1],ln[4]].each{|x| x << l[1]}
            [ln[2],ln[3]].each{|x| x << d}
          when 4
            ln.each{|x| x << l[2]}
          end
        end
        5.times do |i|
          lnb = Marshal.load(Marshal.dump(ln))
          if convp(ln[i], 0)[0] == 10
            puts convp(lnb[i],1)
            throw(:exit)
          end
        end
      end
    end
    p 0
  end
end