op = "+-*"
kb = (0..63).to_a

op = (op*3).split("").combination(3).to_a
op = op.map{|x| x.join}.uniq
kb = kb.map{|x| x.to_s(2)}
kb = kb.map{|x| "0"*(6-x.length) + x}
ka = ("()   ").split("").permutation(5).to_a
ka = ka.map{|x|  x = x.join if("()" == x.join.split.join)}.uniq.compact
ka = ka.find_all {|i| !i.include?("()")}

loop{
	ans = 0
	begin
	a = gets
	b = a.split(' ')
	c = 0
	4.times{|i| c+= b[i].to_i}
	break if(c==0)
	b = b.permutation(4).to_a
	b = b.map{|x| x.join}.uniq
		
	op.size.times{|i|
		kb.size.times{|j|
			b.size.times{|k|
				com = "ans= "
				coms = 0;
				9.times{ |l|
					if(l%2==0)
						6.times{|m|
							com+= ka[m][coms] if(kb[j][m] == '1' && ka[m][coms] == ')')
						}
						if(coms>0 && coms<4)
							com+=op[i][coms-1]
						end
						6.times{|m|
							com+= ka[m][coms] if(kb[j][m] == '1' && ka[m][coms] == '(')
						}
						coms+=1;
					else
						com += b[k][l/2];
					end
				}
				eval (com)
				if(ans == 10)
					puts com.split[-1]
					raise
				else
#					puts com
				end
			}
		}
	}
	rescue
	end
	puts "0" if(ans!=10)
}