#include<algorithm>
#include<iostream>
#include<vector>
#include<stack>
using namespace std;
string judge(int a,int b,int c,int d){
/////////////
/*generator*/
if(((a+(b)+c)*d)==10)return "((a+(b)+c)*d)";
if(((a+(b)+c)+d)==10)return "((a+(b)+c)+d)";
if(((a+(b)+c)-d)==10)return "((a+(b)+c)-d)";
if(((a+(b)-c)*d)==10)return "((a+(b)-c)*d)";
if(((a+(b)-c)+d)==10)return "((a+(b)-c)+d)";
if(((a+(b)-c)-d)==10)return "((a+(b)-c)-d)";
if(((a+b)*(c)+d)==10)return "((a+b)*(c)+d)";
if(((a+b)*(c)-d)==10)return "((a+b)*(c)-d)";
if(((a+b)*c)*d==10)return "((a+b)*c)*d";
if(((a+b)*c)+d==10)return "((a+b)*c)+d";
if(((a+b)*c)-d==10)return "((a+b)*c)-d";
if(((a+b)*c*d)==10)return "((a+b)*c*d)";
if(((a+b)*c+d)==10)return "((a+b)*c+d)";
if(((a+b)*c-d)==10)return "((a+b)*c-d)";
if(((a+b)+(c)+d)==10)return "((a+b)+(c)+d)";
if(((a+b)+(c)-d)==10)return "((a+b)+(c)-d)";
if(((a+b)+c)*d==10)return "((a+b)+c)*d";
if(((a+b)+c)+d==10)return "((a+b)+c)+d";
if(((a+b)+c)-d==10)return "((a+b)+c)-d";
if(((a+b)-(c)+d)==10)return "((a+b)-(c)+d)";
if(((a+b)-(c)-d)==10)return "((a+b)-(c)-d)";
if(((a+b)-c)*d==10)return "((a+b)-c)*d";
if(((a+b)-c)+d==10)return "((a+b)-c)+d";
if(((a+b)-c)-d==10)return "((a+b)-c)-d";
if(((a-(b)+c)*d)==10)return "((a-(b)+c)*d)";
if(((a-(b)+c)+d)==10)return "((a-(b)+c)+d)";
if(((a-(b)+c)-d)==10)return "((a-(b)+c)-d)";
if(((a-(b)-c)*d)==10)return "((a-(b)-c)*d)";
if(((a-(b)-c)+d)==10)return "((a-(b)-c)+d)";
if(((a-(b)-c)-d)==10)return "((a-(b)-c)-d)";
if(((a-b)*(c)+d)==10)return "((a-b)*(c)+d)";
if(((a-b)*(c)-d)==10)return "((a-b)*(c)-d)";
if(((a-b)*c)*d==10)return "((a-b)*c)*d";
if(((a-b)*c)+d==10)return "((a-b)*c)+d";
if(((a-b)*c)-d==10)return "((a-b)*c)-d";
if(((a-b)*c*d)==10)return "((a-b)*c*d)";
if(((a-b)*c+d)==10)return "((a-b)*c+d)";
if(((a-b)*c-d)==10)return "((a-b)*c-d)";
if(((a-b)+(c)+d)==10)return "((a-b)+(c)+d)";
if(((a-b)+(c)-d)==10)return "((a-b)+(c)-d)";
if(((a-b)+c)*d==10)return "((a-b)+c)*d";
if(((a-b)+c)+d==10)return "((a-b)+c)+d";
if(((a-b)+c)-d==10)return "((a-b)+c)-d";
if(((a-b)-(c)+d)==10)return "((a-b)-(c)+d)";
if(((a-b)-(c)-d)==10)return "((a-b)-(c)-d)";
if(((a-b)-c)*d==10)return "((a-b)-c)*d";
if(((a-b)-c)+d==10)return "((a-b)-c)+d";
if(((a-b)-c)-d==10)return "((a-b)-c)-d";
if((a*(b+(c))+d)==10)return "(a*(b+(c))+d)";
if((a*(b+(c))-d)==10)return "(a*(b+(c))-d)";
if((a*(b+(c)+d))==10)return "(a*(b+(c)+d))";
if((a*(b+(c)-d))==10)return "(a*(b+(c)-d))";
if((a*(b+c))*d==10)return "(a*(b+c))*d";
if((a*(b+c))+d==10)return "(a*(b+c))+d";
if((a*(b+c))-d==10)return "(a*(b+c))-d";
if((a*(b+c)*d)==10)return "(a*(b+c)*d)";
if((a*(b+c)+d)==10)return "(a*(b+c)+d)";
if((a*(b+c)-d)==10)return "(a*(b+c)-d)";
if((a*(b-(c))+d)==10)return "(a*(b-(c))+d)";
if((a*(b-(c))-d)==10)return "(a*(b-(c))-d)";
if((a*(b-(c)+d))==10)return "(a*(b-(c)+d))";
if((a*(b-(c)-d))==10)return "(a*(b-(c)-d))";
if((a*(b-c))*d==10)return "(a*(b-c))*d";
if((a*(b-c))+d==10)return "(a*(b-c))+d";
if((a*(b-c))-d==10)return "(a*(b-c))-d";
if((a*(b-c)*d)==10)return "(a*(b-c)*d)";
if((a*(b-c)+d)==10)return "(a*(b-c)+d)";
if((a*(b-c)-d)==10)return "(a*(b-c)-d)";
if((a*b*(c)+d)==10)return "(a*b*(c)+d)";
if((a*b*(c)-d)==10)return "(a*b*(c)-d)";
if((a*b*(c+d))==10)return "(a*b*(c+d))";
if((a*b*(c-d))==10)return "(a*b*(c-d))";
if((a*b*c)*d==10)return "(a*b*c)*d";
if((a*b*c)+d==10)return "(a*b*c)+d";
if((a*b*c)-d==10)return "(a*b*c)-d";
if((a*b*c*d)==10)return "(a*b*c*d)";
if((a*b*c+d)==10)return "(a*b*c+d)";
if((a*b*c-d)==10)return "(a*b*c-d)";
if((a*b+(c)+d)==10)return "(a*b+(c)+d)";
if((a*b+(c)-d)==10)return "(a*b+(c)-d)";
if((a*b+c)*d==10)return "(a*b+c)*d";
if((a*b+c)+d==10)return "(a*b+c)+d";
if((a*b+c)-d==10)return "(a*b+c)-d";
if((a*b-(c)+d)==10)return "(a*b-(c)+d)";
if((a*b-(c)-d)==10)return "(a*b-(c)-d)";
if((a*b-c)*d==10)return "(a*b-c)*d";
if((a*b-c)+d==10)return "(a*b-c)+d";
if((a*b-c)-d==10)return "(a*b-c)-d";
if((a+((b)+c)*d)==10)return "(a+((b)+c)*d)";
if((a+((b)+c)+d)==10)return "(a+((b)+c)+d)";
if((a+((b)+c)-d)==10)return "(a+((b)+c)-d)";
if((a+((b)-c)*d)==10)return "(a+((b)-c)*d)";
if((a+((b)-c)+d)==10)return "(a+((b)-c)+d)";
if((a+((b)-c)-d)==10)return "(a+((b)-c)-d)";
if((a+(b)*(c+d))==10)return "(a+(b)*(c+d))";
if((a+(b)*(c-d))==10)return "(a+(b)*(c-d))";
if((a+(b)*c*d)==10)return "(a+(b)*c*d)";
if((a+(b)*c+d)==10)return "(a+(b)*c+d)";
if((a+(b)*c-d)==10)return "(a+(b)*c-d)";
if((a+(b)+(c)+d)==10)return "(a+(b)+(c)+d)";
if((a+(b)+(c)-d)==10)return "(a+(b)+(c)-d)";
if((a+(b)+(c+d))==10)return "(a+(b)+(c+d))";
if((a+(b)+(c-d))==10)return "(a+(b)+(c-d))";
if((a+(b)+c)*d==10)return "(a+(b)+c)*d";
if((a+(b)+c)+d==10)return "(a+(b)+c)+d";
if((a+(b)+c)-d==10)return "(a+(b)+c)-d";
if((a+(b)+c*d)==10)return "(a+(b)+c*d)";
if((a+(b)+c+d)==10)return "(a+(b)+c+d)";
if((a+(b)+c-d)==10)return "(a+(b)+c-d)";
if((a+(b)-(c)+d)==10)return "(a+(b)-(c)+d)";
if((a+(b)-(c)-d)==10)return "(a+(b)-(c)-d)";
if((a+(b)-(c+d))==10)return "(a+(b)-(c+d))";
if((a+(b)-(c-d))==10)return "(a+(b)-(c-d))";
if((a+(b)-c)*d==10)return "(a+(b)-c)*d";
if((a+(b)-c)+d==10)return "(a+(b)-c)+d";
if((a+(b)-c)-d==10)return "(a+(b)-c)-d";
if((a+(b)-c*d)==10)return "(a+(b)-c*d)";
if((a+(b)-c+d)==10)return "(a+(b)-c+d)";
if((a+(b)-c-d)==10)return "(a+(b)-c-d)";
if((a+(b+(c))+d)==10)return "(a+(b+(c))+d)";
if((a+(b+(c))-d)==10)return "(a+(b+(c))-d)";
if((a+(b+(c)+d))==10)return "(a+(b+(c)+d))";
if((a+(b+(c)-d))==10)return "(a+(b+(c)-d))";
if((a+(b+c))*d==10)return "(a+(b+c))*d";
if((a+(b+c))+d==10)return "(a+(b+c))+d";
if((a+(b+c))-d==10)return "(a+(b+c))-d";
if((a+(b+c)*d)==10)return "(a+(b+c)*d)";
if((a+(b+c)+d)==10)return "(a+(b+c)+d)";
if((a+(b+c)-d)==10)return "(a+(b+c)-d)";
if((a+(b-(c))+d)==10)return "(a+(b-(c))+d)";
if((a+(b-(c))-d)==10)return "(a+(b-(c))-d)";
if((a+(b-(c)+d))==10)return "(a+(b-(c)+d))";
if((a+(b-(c)-d))==10)return "(a+(b-(c)-d))";
if((a+(b-c))*d==10)return "(a+(b-c))*d";
if((a+(b-c))+d==10)return "(a+(b-c))+d";
if((a+(b-c))-d==10)return "(a+(b-c))-d";
if((a+(b-c)*d)==10)return "(a+(b-c)*d)";
if((a+(b-c)+d)==10)return "(a+(b-c)+d)";
if((a+(b-c)-d)==10)return "(a+(b-c)-d)";
if((a+b)*(c+d)==10)return "(a+b)*(c+d)";
if((a+b)*(c-d)==10)return "(a+b)*(c-d)";
if((a+b)*c*d==10)return "(a+b)*c*d";
if((a+b)*c+d==10)return "(a+b)*c+d";
if((a+b)*c-d==10)return "(a+b)*c-d";
if((a+b)+(c+d)==10)return "(a+b)+(c+d)";
if((a+b)+(c-d)==10)return "(a+b)+(c-d)";
if((a+b)+c*d==10)return "(a+b)+c*d";
if((a+b)+c+d==10)return "(a+b)+c+d";
if((a+b)+c-d==10)return "(a+b)+c-d";
if((a+b)-(c+d)==10)return "(a+b)-(c+d)";
if((a+b)-(c-d)==10)return "(a+b)-(c-d)";
if((a+b)-c*d==10)return "(a+b)-c*d";
if((a+b)-c+d==10)return "(a+b)-c+d";
if((a+b)-c-d==10)return "(a+b)-c-d";
if((a+b*(c)+d)==10)return "(a+b*(c)+d)";
if((a+b*(c)-d)==10)return "(a+b*(c)-d)";
if((a+b*(c+d))==10)return "(a+b*(c+d))";
if((a+b*(c-d))==10)return "(a+b*(c-d))";
if((a+b*c)*d==10)return "(a+b*c)*d";
if((a+b*c)+d==10)return "(a+b*c)+d";
if((a+b*c)-d==10)return "(a+b*c)-d";
if((a+b*c*d)==10)return "(a+b*c*d)";
if((a+b*c+d)==10)return "(a+b*c+d)";
if((a+b*c-d)==10)return "(a+b*c-d)";
if((a+b+(c)+d)==10)return "(a+b+(c)+d)";
if((a+b+(c)-d)==10)return "(a+b+(c)-d)";
if((a+b+c)*d==10)return "(a+b+c)*d";
if((a+b+c)+d==10)return "(a+b+c)+d";
if((a+b+c)-d==10)return "(a+b+c)-d";
if((a+b-(c)+d)==10)return "(a+b-(c)+d)";
if((a+b-(c)-d)==10)return "(a+b-(c)-d)";
if((a+b-c)*d==10)return "(a+b-c)*d";
if((a+b-c)+d==10)return "(a+b-c)+d";
if((a+b-c)-d==10)return "(a+b-c)-d";
if((a-((b)+c)*d)==10)return "(a-((b)+c)*d)";
if((a-((b)+c)+d)==10)return "(a-((b)+c)+d)";
if((a-((b)+c)-d)==10)return "(a-((b)+c)-d)";
if((a-((b)-c)*d)==10)return "(a-((b)-c)*d)";
if((a-((b)-c)+d)==10)return "(a-((b)-c)+d)";
if((a-((b)-c)-d)==10)return "(a-((b)-c)-d)";
if((a-(b)*(c+d))==10)return "(a-(b)*(c+d))";
if((a-(b)*(c-d))==10)return "(a-(b)*(c-d))";
if((a-(b)*c*d)==10)return "(a-(b)*c*d)";
if((a-(b)*c+d)==10)return "(a-(b)*c+d)";
if((a-(b)*c-d)==10)return "(a-(b)*c-d)";
if((a-(b)+(c)+d)==10)return "(a-(b)+(c)+d)";
if((a-(b)+(c)-d)==10)return "(a-(b)+(c)-d)";
if((a-(b)+(c+d))==10)return "(a-(b)+(c+d))";
if((a-(b)+(c-d))==10)return "(a-(b)+(c-d))";
if((a-(b)+c)*d==10)return "(a-(b)+c)*d";
if((a-(b)+c)+d==10)return "(a-(b)+c)+d";
if((a-(b)+c)-d==10)return "(a-(b)+c)-d";
if((a-(b)+c*d)==10)return "(a-(b)+c*d)";
if((a-(b)+c+d)==10)return "(a-(b)+c+d)";
if((a-(b)+c-d)==10)return "(a-(b)+c-d)";
if((a-(b)-(c)+d)==10)return "(a-(b)-(c)+d)";
if((a-(b)-(c)-d)==10)return "(a-(b)-(c)-d)";
if((a-(b)-(c+d))==10)return "(a-(b)-(c+d))";
if((a-(b)-(c-d))==10)return "(a-(b)-(c-d))";
if((a-(b)-c)*d==10)return "(a-(b)-c)*d";
if((a-(b)-c)+d==10)return "(a-(b)-c)+d";
if((a-(b)-c)-d==10)return "(a-(b)-c)-d";
if((a-(b)-c*d)==10)return "(a-(b)-c*d)";
if((a-(b)-c+d)==10)return "(a-(b)-c+d)";
if((a-(b)-c-d)==10)return "(a-(b)-c-d)";
if((a-(b+(c))+d)==10)return "(a-(b+(c))+d)";
if((a-(b+(c))-d)==10)return "(a-(b+(c))-d)";
if((a-(b+(c)+d))==10)return "(a-(b+(c)+d))";
if((a-(b+(c)-d))==10)return "(a-(b+(c)-d))";
if((a-(b+c))*d==10)return "(a-(b+c))*d";
if((a-(b+c))+d==10)return "(a-(b+c))+d";
if((a-(b+c))-d==10)return "(a-(b+c))-d";
if((a-(b+c)*d)==10)return "(a-(b+c)*d)";
if((a-(b+c)+d)==10)return "(a-(b+c)+d)";
if((a-(b+c)-d)==10)return "(a-(b+c)-d)";
if((a-(b-(c))+d)==10)return "(a-(b-(c))+d)";
if((a-(b-(c))-d)==10)return "(a-(b-(c))-d)";
if((a-(b-(c)+d))==10)return "(a-(b-(c)+d))";
if((a-(b-(c)-d))==10)return "(a-(b-(c)-d))";
if((a-(b-c))*d==10)return "(a-(b-c))*d";
if((a-(b-c))+d==10)return "(a-(b-c))+d";
if((a-(b-c))-d==10)return "(a-(b-c))-d";
if((a-(b-c)*d)==10)return "(a-(b-c)*d)";
if((a-(b-c)+d)==10)return "(a-(b-c)+d)";
if((a-(b-c)-d)==10)return "(a-(b-c)-d)";
if((a-b)*(c+d)==10)return "(a-b)*(c+d)";
if((a-b)*(c-d)==10)return "(a-b)*(c-d)";
if((a-b)*c*d==10)return "(a-b)*c*d";
if((a-b)*c+d==10)return "(a-b)*c+d";
if((a-b)*c-d==10)return "(a-b)*c-d";
if((a-b)+(c+d)==10)return "(a-b)+(c+d)";
if((a-b)+(c-d)==10)return "(a-b)+(c-d)";
if((a-b)+c*d==10)return "(a-b)+c*d";
if((a-b)+c+d==10)return "(a-b)+c+d";
if((a-b)+c-d==10)return "(a-b)+c-d";
if((a-b)-(c+d)==10)return "(a-b)-(c+d)";
if((a-b)-(c-d)==10)return "(a-b)-(c-d)";
if((a-b)-c*d==10)return "(a-b)-c*d";
if((a-b)-c+d==10)return "(a-b)-c+d";
if((a-b)-c-d==10)return "(a-b)-c-d";
if((a-b*(c)+d)==10)return "(a-b*(c)+d)";
if((a-b*(c)-d)==10)return "(a-b*(c)-d)";
if((a-b*(c+d))==10)return "(a-b*(c+d))";
if((a-b*(c-d))==10)return "(a-b*(c-d))";
if((a-b*c)*d==10)return "(a-b*c)*d";
if((a-b*c)+d==10)return "(a-b*c)+d";
if((a-b*c)-d==10)return "(a-b*c)-d";
if((a-b*c*d)==10)return "(a-b*c*d)";
if((a-b*c+d)==10)return "(a-b*c+d)";
if((a-b*c-d)==10)return "(a-b*c-d)";
if((a-b+(c)+d)==10)return "(a-b+(c)+d)";
if((a-b+(c)-d)==10)return "(a-b+(c)-d)";
if((a-b+c)*d==10)return "(a-b+c)*d";
if((a-b+c)+d==10)return "(a-b+c)+d";
if((a-b+c)-d==10)return "(a-b+c)-d";
if((a-b-(c)+d)==10)return "(a-b-(c)+d)";
if((a-b-(c)-d)==10)return "(a-b-(c)-d)";
if((a-b-c)*d==10)return "(a-b-c)*d";
if((a-b-c)+d==10)return "(a-b-c)+d";
if((a-b-c)-d==10)return "(a-b-c)-d";
if(a*((b+c)*d)==10)return "a*((b+c)*d)";
if(a*((b+c)+d)==10)return "a*((b+c)+d)";
if(a*((b+c)-d)==10)return "a*((b+c)-d)";
if(a*((b-c)*d)==10)return "a*((b-c)*d)";
if(a*((b-c)+d)==10)return "a*((b-c)+d)";
if(a*((b-c)-d)==10)return "a*((b-c)-d)";
if(a*(b*(c+d))==10)return "a*(b*(c+d))";
if(a*(b*(c-d))==10)return "a*(b*(c-d))";
if(a*(b*c*d)==10)return "a*(b*c*d)";
if(a*(b*c+d)==10)return "a*(b*c+d)";
if(a*(b*c-d)==10)return "a*(b*c-d)";
if(a*(b+(c)+d)==10)return "a*(b+(c)+d)";
if(a*(b+(c)-d)==10)return "a*(b+(c)-d)";
if(a*(b+(c+d))==10)return "a*(b+(c+d))";
if(a*(b+(c-d))==10)return "a*(b+(c-d))";
if(a*(b+c)*d==10)return "a*(b+c)*d";
if(a*(b+c)+d==10)return "a*(b+c)+d";
if(a*(b+c)-d==10)return "a*(b+c)-d";
if(a*(b+c*d)==10)return "a*(b+c*d)";
if(a*(b+c+d)==10)return "a*(b+c+d)";
if(a*(b+c-d)==10)return "a*(b+c-d)";
if(a*(b-(c)+d)==10)return "a*(b-(c)+d)";
if(a*(b-(c)-d)==10)return "a*(b-(c)-d)";
if(a*(b-(c+d))==10)return "a*(b-(c+d))";
if(a*(b-(c-d))==10)return "a*(b-(c-d))";
if(a*(b-c)*d==10)return "a*(b-c)*d";
if(a*(b-c)+d==10)return "a*(b-c)+d";
if(a*(b-c)-d==10)return "a*(b-c)-d";
if(a*(b-c*d)==10)return "a*(b-c*d)";
if(a*(b-c+d)==10)return "a*(b-c+d)";
if(a*(b-c-d)==10)return "a*(b-c-d)";
if(a*b*(c+d)==10)return "a*b*(c+d)";
if(a*b*(c-d)==10)return "a*b*(c-d)";
if(a*b*c*d==10)return "a*b*c*d";
if(a*b*c+d==10)return "a*b*c+d";
if(a*b*c-d==10)return "a*b*c-d";
if(a*b+(c+d)==10)return "a*b+(c+d)";
if(a*b+(c-d)==10)return "a*b+(c-d)";
if(a*b+c*d==10)return "a*b+c*d";
if(a*b+c+d==10)return "a*b+c+d";
if(a*b+c-d==10)return "a*b+c-d";
if(a*b-(c+d)==10)return "a*b-(c+d)";
if(a*b-(c-d)==10)return "a*b-(c-d)";
if(a*b-c*d==10)return "a*b-c*d";
if(a*b-c+d==10)return "a*b-c+d";
if(a*b-c-d==10)return "a*b-c-d";
if(a+((b+c)*d)==10)return "a+((b+c)*d)";
if(a+((b+c)+d)==10)return "a+((b+c)+d)";
if(a+((b+c)-d)==10)return "a+((b+c)-d)";
if(a+((b-c)*d)==10)return "a+((b-c)*d)";
if(a+((b-c)+d)==10)return "a+((b-c)+d)";
if(a+((b-c)-d)==10)return "a+((b-c)-d)";
if(a+(b*(c+d))==10)return "a+(b*(c+d))";
if(a+(b*(c-d))==10)return "a+(b*(c-d))";
if(a+(b*c*d)==10)return "a+(b*c*d)";
if(a+(b*c+d)==10)return "a+(b*c+d)";
if(a+(b*c-d)==10)return "a+(b*c-d)";
if(a+(b+(c)+d)==10)return "a+(b+(c)+d)";
if(a+(b+(c)-d)==10)return "a+(b+(c)-d)";
if(a+(b+(c+d))==10)return "a+(b+(c+d))";
if(a+(b+(c-d))==10)return "a+(b+(c-d))";
if(a+(b+c)*d==10)return "a+(b+c)*d";
if(a+(b+c)+d==10)return "a+(b+c)+d";
if(a+(b+c)-d==10)return "a+(b+c)-d";
if(a+(b+c*d)==10)return "a+(b+c*d)";
if(a+(b+c+d)==10)return "a+(b+c+d)";
if(a+(b+c-d)==10)return "a+(b+c-d)";
if(a+(b-(c)+d)==10)return "a+(b-(c)+d)";
if(a+(b-(c)-d)==10)return "a+(b-(c)-d)";
if(a+(b-(c+d))==10)return "a+(b-(c+d))";
if(a+(b-(c-d))==10)return "a+(b-(c-d))";
if(a+(b-c)*d==10)return "a+(b-c)*d";
if(a+(b-c)+d==10)return "a+(b-c)+d";
if(a+(b-c)-d==10)return "a+(b-c)-d";
if(a+(b-c*d)==10)return "a+(b-c*d)";
if(a+(b-c+d)==10)return "a+(b-c+d)";
if(a+(b-c-d)==10)return "a+(b-c-d)";
if(a+b*(c+d)==10)return "a+b*(c+d)";
if(a+b*(c-d)==10)return "a+b*(c-d)";
if(a+b*c*d==10)return "a+b*c*d";
if(a+b*c+d==10)return "a+b*c+d";
if(a+b*c-d==10)return "a+b*c-d";
if(a+b+(c+d)==10)return "a+b+(c+d)";
if(a+b+(c-d)==10)return "a+b+(c-d)";
if(a+b+c*d==10)return "a+b+c*d";
if(a+b+c+d==10)return "a+b+c+d";
if(a+b+c-d==10)return "a+b+c-d";
if(a+b-(c+d)==10)return "a+b-(c+d)";
if(a+b-(c-d)==10)return "a+b-(c-d)";
if(a+b-c*d==10)return "a+b-c*d";
if(a+b-c+d==10)return "a+b-c+d";
if(a+b-c-d==10)return "a+b-c-d";
if(a-((b+c)*d)==10)return "a-((b+c)*d)";
if(a-((b+c)+d)==10)return "a-((b+c)+d)";
if(a-((b+c)-d)==10)return "a-((b+c)-d)";
if(a-((b-c)*d)==10)return "a-((b-c)*d)";
if(a-((b-c)+d)==10)return "a-((b-c)+d)";
if(a-((b-c)-d)==10)return "a-((b-c)-d)";
if(a-(b*(c+d))==10)return "a-(b*(c+d))";
if(a-(b*(c-d))==10)return "a-(b*(c-d))";
if(a-(b*c*d)==10)return "a-(b*c*d)";
if(a-(b*c+d)==10)return "a-(b*c+d)";
if(a-(b*c-d)==10)return "a-(b*c-d)";
if(a-(b+(c)+d)==10)return "a-(b+(c)+d)";
if(a-(b+(c)-d)==10)return "a-(b+(c)-d)";
if(a-(b+(c+d))==10)return "a-(b+(c+d))";
if(a-(b+(c-d))==10)return "a-(b+(c-d))";
if(a-(b+c)*d==10)return "a-(b+c)*d";
if(a-(b+c)+d==10)return "a-(b+c)+d";
if(a-(b+c)-d==10)return "a-(b+c)-d";
if(a-(b+c*d)==10)return "a-(b+c*d)";
if(a-(b+c+d)==10)return "a-(b+c+d)";
if(a-(b+c-d)==10)return "a-(b+c-d)";
if(a-(b-(c)+d)==10)return "a-(b-(c)+d)";
if(a-(b-(c)-d)==10)return "a-(b-(c)-d)";
if(a-(b-(c+d))==10)return "a-(b-(c+d))";
if(a-(b-(c-d))==10)return "a-(b-(c-d))";
if(a-(b-c)*d==10)return "a-(b-c)*d";
if(a-(b-c)+d==10)return "a-(b-c)+d";
if(a-(b-c)-d==10)return "a-(b-c)-d";
if(a-(b-c*d)==10)return "a-(b-c*d)";
if(a-(b-c+d)==10)return "a-(b-c+d)";
if(a-(b-c-d)==10)return "a-(b-c-d)";
if(a-b*(c+d)==10)return "a-b*(c+d)";
if(a-b*(c-d)==10)return "a-b*(c-d)";
if(a-b*c*d==10)return "a-b*c*d";
if(a-b*c+d==10)return "a-b*c+d";
if(a-b*c-d==10)return "a-b*c-d";
if(a-b+(c+d)==10)return "a-b+(c+d)";
if(a-b+(c-d)==10)return "a-b+(c-d)";
if(a-b+c*d==10)return "a-b+c*d";
if(a-b+c+d==10)return "a-b+c+d";
if(a-b+c-d==10)return "a-b+c-d";
if(a-b-(c+d)==10)return "a-b-(c+d)";
if(a-b-(c-d)==10)return "a-b-(c-d)";
if(a-b-c*d==10)return "a-b-c*d";
if(a-b-c+d==10)return "a-b-c+d";
if(a-b-c-d==10)return "a-b-c-d";

/////////////
  return "no";
}

string convert(string s,vector<int>& in){
  string res="";
  for(int i=0;i<s.size();i++){
    if(s[i]=='a'){
      res += to_string(in[0]);
    }else if(s[i]=='b'){
      res += to_string(in[1]);
    }else if(s[i]=='c'){
      res += to_string(in[2]);
    }else if(s[i]=='d'){
      res += to_string(in[3]);
    }else{
      res += s[i];
    } 
  }
  return res;
}
 

int main(){
  vector<int> in;
  while(1){
    in.clear();in.resize(4);
    for(int i=0;i<4;i++){
      cin>>in[i];
    }
    if(in[0]==0 && in[1]==0 && in[2]==0 && in[3]==0)break;
    sort(in.begin(),in.end());
    while(1){
      string tmp = judge(in[0],in[1],in[2],in[3]);
      if(tmp!="no"){
        cout<<convert(tmp,in)<<endl;
        break;
      }
      if(!next_permutation(in.begin(),in.end())){
        cout<<0<<endl;
        break;
      } 
    }
  }
}

Measured memory_bytes: 1260