#include <iostream>
#include <string>
#include <math.h>
#include <map>
#include <stdio.h>
#include <ctype.h>
#include <algorithm>
#include <stdlib.h>
#include <stack>
#include <queue>

using namespace std;

int main() {
    char num[4];
    
    
    while(cin>>num[0]>>num[1]>>num[2]>>num[3]){
        //cout<<num[0]<<endl;
        if(num[0]=='0'&&num[1]=='0'&&num[2]=='0'&&num[3]=='0'){
            return 0;
        }else{
            int ans=0;
            do{
                int a, b, c, d;
                a=num[0]-'0';
                b=num[1]-'0';
                c=num[2]-'0';
                d=num[3]-'0';
                //cout<<a<<b<<c<<d<<endl;
                
                ans = (((a+b)+c)+d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"+"<<b<<")"<<"+"<<c<<")"<<"+"<<d<<")"<<endl;break;}
                ans = ((a+b)+(c+d)); if(ans == 10){cout<<"("<<"("<<a<<"+"<<b<<")"<<"+"<<"("<<c<<"+"<<d<<")"<<")"<<endl;break;}
                ans = ((a+(b+c))+d); if(ans == 10){cout<<"("<<"("<<a<<"+"<<"("<<b<<"+"<<c<<")"<<")"<<"+"<<d<<")"<<endl;break;}
                ans = (a+((b+c)+d)); if(ans == 10){cout<<"("<<a<<"+"<<"("<<"("<<b<<"+"<<c<<")"<<"+"<<d<<")"<<")"<<endl;break;}
                ans = (a+(b+(c+d))); if(ans == 10){cout<<"("<<a<<"+"<<"("<<b<<"+"<<"("<<c<<"+"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a+b)+c)*d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"+"<<b<<")"<<"+"<<c<<")"<<"*"<<d<<")"<<endl;break;}
                ans = ((a+b)+(c*d)); if(ans == 10){cout<<"("<<"("<<a<<"+"<<b<<")"<<"+"<<"("<<c<<"*"<<d<<")"<<")"<<endl;break;}
                ans = ((a+(b+c))*d); if(ans == 10){cout<<"("<<"("<<a<<"+"<<"("<<b<<"+"<<c<<")"<<")"<<"*"<<d<<")"<<endl;break;}
                ans = (a+((b+c)*d)); if(ans == 10){cout<<"("<<a<<"+"<<"("<<"("<<b<<"+"<<c<<")"<<"*"<<d<<")"<<")"<<endl;break;}
                ans = (a+(b+(c*d))); if(ans == 10){cout<<"("<<a<<"+"<<"("<<b<<"+"<<"("<<c<<"*"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a+b)+c)-d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"+"<<b<<")"<<"+"<<c<<")"<<"-"<<d<<")"<<endl;break;}
                ans = ((a+b)+(c-d)); if(ans == 10){cout<<"("<<"("<<a<<"+"<<b<<")"<<"+"<<"("<<c<<"-"<<d<<")"<<")"<<endl;break;}
                ans = ((a+(b+c))-d); if(ans == 10){cout<<"("<<"("<<a<<"+"<<"("<<b<<"+"<<c<<")"<<")"<<"-"<<d<<")"<<endl;break;}
                ans = (a+((b+c)-d)); if(ans == 10){cout<<"("<<a<<"+"<<"("<<"("<<b<<"+"<<c<<")"<<"-"<<d<<")"<<")"<<endl;break;}
                ans = (a+(b+(c-d))); if(ans == 10){cout<<"("<<a<<"+"<<"("<<b<<"+"<<"("<<c<<"-"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a+b)*c)+d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"+"<<b<<")"<<"*"<<c<<")"<<"+"<<d<<")"<<endl;break;}
                ans = ((a+b)*(c+d)); if(ans == 10){cout<<"("<<"("<<a<<"+"<<b<<")"<<"*"<<"("<<c<<"+"<<d<<")"<<")"<<endl;break;}
                ans = ((a+(b*c))+d); if(ans == 10){cout<<"("<<"("<<a<<"+"<<"("<<b<<"*"<<c<<")"<<")"<<"+"<<d<<")"<<endl;break;}
                ans = (a+((b*c)+d)); if(ans == 10){cout<<"("<<a<<"+"<<"("<<"("<<b<<"*"<<c<<")"<<"+"<<d<<")"<<")"<<endl;break;}
                ans = (a+(b*(c+d))); if(ans == 10){cout<<"("<<a<<"+"<<"("<<b<<"*"<<"("<<c<<"+"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a+b)*c)*d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"+"<<b<<")"<<"*"<<c<<")"<<"*"<<d<<")"<<endl;break;}
                ans = ((a+b)*(c*d)); if(ans == 10){cout<<"("<<"("<<a<<"+"<<b<<")"<<"*"<<"("<<c<<"*"<<d<<")"<<")"<<endl;break;}
                ans = ((a+(b*c))*d); if(ans == 10){cout<<"("<<"("<<a<<"+"<<"("<<b<<"*"<<c<<")"<<")"<<"*"<<d<<")"<<endl;break;}
                ans = (a+((b*c)*d)); if(ans == 10){cout<<"("<<a<<"+"<<"("<<"("<<b<<"*"<<c<<")"<<"*"<<d<<")"<<")"<<endl;break;}
                ans = (a+(b*(c*d))); if(ans == 10){cout<<"("<<a<<"+"<<"("<<b<<"*"<<"("<<c<<"*"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a+b)*c)-d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"+"<<b<<")"<<"*"<<c<<")"<<"-"<<d<<")"<<endl;break;}
                ans = ((a+b)*(c-d)); if(ans == 10){cout<<"("<<"("<<a<<"+"<<b<<")"<<"*"<<"("<<c<<"-"<<d<<")"<<")"<<endl;break;}
                ans = ((a+(b*c))-d); if(ans == 10){cout<<"("<<"("<<a<<"+"<<"("<<b<<"*"<<c<<")"<<")"<<"-"<<d<<")"<<endl;break;}
                ans = (a+((b*c)-d)); if(ans == 10){cout<<"("<<a<<"+"<<"("<<"("<<b<<"*"<<c<<")"<<"-"<<d<<")"<<")"<<endl;break;}
                ans = (a+(b*(c-d))); if(ans == 10){cout<<"("<<a<<"+"<<"("<<b<<"*"<<"("<<c<<"-"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a+b)-c)+d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"+"<<b<<")"<<"-"<<c<<")"<<"+"<<d<<")"<<endl;break;}
                ans = ((a+b)-(c+d)); if(ans == 10){cout<<"("<<"("<<a<<"+"<<b<<")"<<"-"<<"("<<c<<"+"<<d<<")"<<")"<<endl;break;}
                ans = ((a+(b-c))+d); if(ans == 10){cout<<"("<<"("<<a<<"+"<<"("<<b<<"-"<<c<<")"<<")"<<"+"<<d<<")"<<endl;break;}
                ans = (a+((b-c)+d)); if(ans == 10){cout<<"("<<a<<"+"<<"("<<"("<<b<<"-"<<c<<")"<<"+"<<d<<")"<<")"<<endl;break;}
                ans = (a+(b-(c+d))); if(ans == 10){cout<<"("<<a<<"+"<<"("<<b<<"-"<<"("<<c<<"+"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a+b)-c)*d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"+"<<b<<")"<<"-"<<c<<")"<<"*"<<d<<")"<<endl;break;}
                ans = ((a+b)-(c*d)); if(ans == 10){cout<<"("<<"("<<a<<"+"<<b<<")"<<"-"<<"("<<c<<"*"<<d<<")"<<")"<<endl;break;}
                ans = ((a+(b-c))*d); if(ans == 10){cout<<"("<<"("<<a<<"+"<<"("<<b<<"-"<<c<<")"<<")"<<"*"<<d<<")"<<endl;break;}
                ans = (a+((b-c)*d)); if(ans == 10){cout<<"("<<a<<"+"<<"("<<"("<<b<<"-"<<c<<")"<<"*"<<d<<")"<<")"<<endl;break;}
                ans = (a+(b-(c*d))); if(ans == 10){cout<<"("<<a<<"+"<<"("<<b<<"-"<<"("<<c<<"*"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a+b)-c)-d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"+"<<b<<")"<<"-"<<c<<")"<<"-"<<d<<")"<<endl;break;}
                ans = ((a+b)-(c-d)); if(ans == 10){cout<<"("<<"("<<a<<"+"<<b<<")"<<"-"<<"("<<c<<"-"<<d<<")"<<")"<<endl;break;}
                ans = ((a+(b-c))-d); if(ans == 10){cout<<"("<<"("<<a<<"+"<<"("<<b<<"-"<<c<<")"<<")"<<"-"<<d<<")"<<endl;break;}
                ans = (a+((b-c)-d)); if(ans == 10){cout<<"("<<a<<"+"<<"("<<"("<<b<<"-"<<c<<")"<<"-"<<d<<")"<<")"<<endl;break;}
                ans = (a+(b-(c-d))); if(ans == 10){cout<<"("<<a<<"+"<<"("<<b<<"-"<<"("<<c<<"-"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a*b)+c)+d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"*"<<b<<")"<<"+"<<c<<")"<<"+"<<d<<")"<<endl;break;}
                ans = ((a*b)+(c+d)); if(ans == 10){cout<<"("<<"("<<a<<"*"<<b<<")"<<"+"<<"("<<c<<"+"<<d<<")"<<")"<<endl;break;}
                ans = ((a*(b+c))+d); if(ans == 10){cout<<"("<<"("<<a<<"*"<<"("<<b<<"+"<<c<<")"<<")"<<"+"<<d<<")"<<endl;break;}
                ans = (a*((b+c)+d)); if(ans == 10){cout<<"("<<a<<"*"<<"("<<"("<<b<<"+"<<c<<")"<<"+"<<d<<")"<<")"<<endl;break;}
                ans = (a*(b+(c+d))); if(ans == 10){cout<<"("<<a<<"*"<<"("<<b<<"+"<<"("<<c<<"+"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a*b)+c)*d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"*"<<b<<")"<<"+"<<c<<")"<<"*"<<d<<")"<<endl;break;}
                ans = ((a*b)+(c*d)); if(ans == 10){cout<<"("<<"("<<a<<"*"<<b<<")"<<"+"<<"("<<c<<"*"<<d<<")"<<")"<<endl;break;}
                ans = ((a*(b+c))*d); if(ans == 10){cout<<"("<<"("<<a<<"*"<<"("<<b<<"+"<<c<<")"<<")"<<"*"<<d<<")"<<endl;break;}
                ans = (a*((b+c)*d)); if(ans == 10){cout<<"("<<a<<"*"<<"("<<"("<<b<<"+"<<c<<")"<<"*"<<d<<")"<<")"<<endl;break;}
                ans = (a*(b+(c*d))); if(ans == 10){cout<<"("<<a<<"*"<<"("<<b<<"+"<<"("<<c<<"*"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a*b)+c)-d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"*"<<b<<")"<<"+"<<c<<")"<<"-"<<d<<")"<<endl;break;}
                ans = ((a*b)+(c-d)); if(ans == 10){cout<<"("<<"("<<a<<"*"<<b<<")"<<"+"<<"("<<c<<"-"<<d<<")"<<")"<<endl;break;}
                ans = ((a*(b+c))-d); if(ans == 10){cout<<"("<<"("<<a<<"*"<<"("<<b<<"+"<<c<<")"<<")"<<"-"<<d<<")"<<endl;break;}
                ans = (a*((b+c)-d)); if(ans == 10){cout<<"("<<a<<"*"<<"("<<"("<<b<<"+"<<c<<")"<<"-"<<d<<")"<<")"<<endl;break;}
                ans = (a*(b+(c-d))); if(ans == 10){cout<<"("<<a<<"*"<<"("<<b<<"+"<<"("<<c<<"-"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a*b)*c)+d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"*"<<b<<")"<<"*"<<c<<")"<<"+"<<d<<")"<<endl;break;}
                ans = ((a*b)*(c+d)); if(ans == 10){cout<<"("<<"("<<a<<"*"<<b<<")"<<"*"<<"("<<c<<"+"<<d<<")"<<")"<<endl;break;}
                ans = ((a*(b*c))+d); if(ans == 10){cout<<"("<<"("<<a<<"*"<<"("<<b<<"*"<<c<<")"<<")"<<"+"<<d<<")"<<endl;break;}
                ans = (a*((b*c)+d)); if(ans == 10){cout<<"("<<a<<"*"<<"("<<"("<<b<<"*"<<c<<")"<<"+"<<d<<")"<<")"<<endl;break;}
                ans = (a*(b*(c+d))); if(ans == 10){cout<<"("<<a<<"*"<<"("<<b<<"*"<<"("<<c<<"+"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a*b)*c)*d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"*"<<b<<")"<<"*"<<c<<")"<<"*"<<d<<")"<<endl;break;}
                ans = ((a*b)*(c*d)); if(ans == 10){cout<<"("<<"("<<a<<"*"<<b<<")"<<"*"<<"("<<c<<"*"<<d<<")"<<")"<<endl;break;}
                ans = ((a*(b*c))*d); if(ans == 10){cout<<"("<<"("<<a<<"*"<<"("<<b<<"*"<<c<<")"<<")"<<"*"<<d<<")"<<endl;break;}
                ans = (a*((b*c)*d)); if(ans == 10){cout<<"("<<a<<"*"<<"("<<"("<<b<<"*"<<c<<")"<<"*"<<d<<")"<<")"<<endl;break;}
                ans = (a*(b*(c*d))); if(ans == 10){cout<<"("<<a<<"*"<<"("<<b<<"*"<<"("<<c<<"*"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a*b)*c)-d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"*"<<b<<")"<<"*"<<c<<")"<<"-"<<d<<")"<<endl;break;}
                ans = ((a*b)*(c-d)); if(ans == 10){cout<<"("<<"("<<a<<"*"<<b<<")"<<"*"<<"("<<c<<"-"<<d<<")"<<")"<<endl;break;}
                ans = ((a*(b*c))-d); if(ans == 10){cout<<"("<<"("<<a<<"*"<<"("<<b<<"*"<<c<<")"<<")"<<"-"<<d<<")"<<endl;break;}
                ans = (a*((b*c)-d)); if(ans == 10){cout<<"("<<a<<"*"<<"("<<"("<<b<<"*"<<c<<")"<<"-"<<d<<")"<<")"<<endl;break;}
                ans = (a*(b*(c-d))); if(ans == 10){cout<<"("<<a<<"*"<<"("<<b<<"*"<<"("<<c<<"-"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a*b)-c)+d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"*"<<b<<")"<<"-"<<c<<")"<<"+"<<d<<")"<<endl;break;}
                ans = ((a*b)-(c+d)); if(ans == 10){cout<<"("<<"("<<a<<"*"<<b<<")"<<"-"<<"("<<c<<"+"<<d<<")"<<")"<<endl;break;}
                ans = ((a*(b-c))+d); if(ans == 10){cout<<"("<<"("<<a<<"*"<<"("<<b<<"-"<<c<<")"<<")"<<"+"<<d<<")"<<endl;break;}
                ans = (a*((b-c)+d)); if(ans == 10){cout<<"("<<a<<"*"<<"("<<"("<<b<<"-"<<c<<")"<<"+"<<d<<")"<<")"<<endl;break;}
                ans = (a*(b-(c+d))); if(ans == 10){cout<<"("<<a<<"*"<<"("<<b<<"-"<<"("<<c<<"+"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a*b)-c)*d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"*"<<b<<")"<<"-"<<c<<")"<<"*"<<d<<")"<<endl;break;}
                ans = ((a*b)-(c*d)); if(ans == 10){cout<<"("<<"("<<a<<"*"<<b<<")"<<"-"<<"("<<c<<"*"<<d<<")"<<")"<<endl;break;}
                ans = ((a*(b-c))*d); if(ans == 10){cout<<"("<<"("<<a<<"*"<<"("<<b<<"-"<<c<<")"<<")"<<"*"<<d<<")"<<endl;break;}
                ans = (a*((b-c)*d)); if(ans == 10){cout<<"("<<a<<"*"<<"("<<"("<<b<<"-"<<c<<")"<<"*"<<d<<")"<<")"<<endl;break;}
                ans = (a*(b-(c*d))); if(ans == 10){cout<<"("<<a<<"*"<<"("<<b<<"-"<<"("<<c<<"*"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a*b)-c)-d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"*"<<b<<")"<<"-"<<c<<")"<<"-"<<d<<")"<<endl;break;}
                ans = ((a*b)-(c-d)); if(ans == 10){cout<<"("<<"("<<a<<"*"<<b<<")"<<"-"<<"("<<c<<"-"<<d<<")"<<")"<<endl;break;}
                ans = ((a*(b-c))-d); if(ans == 10){cout<<"("<<"("<<a<<"*"<<"("<<b<<"-"<<c<<")"<<")"<<"-"<<d<<")"<<endl;break;}
                ans = (a*((b-c)-d)); if(ans == 10){cout<<"("<<a<<"*"<<"("<<"("<<b<<"-"<<c<<")"<<"-"<<d<<")"<<")"<<endl;break;}
                ans = (a*(b-(c-d))); if(ans == 10){cout<<"("<<a<<"*"<<"("<<b<<"-"<<"("<<c<<"-"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a-b)+c)+d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"-"<<b<<")"<<"+"<<c<<")"<<"+"<<d<<")"<<endl;break;}
                ans = ((a-b)+(c+d)); if(ans == 10){cout<<"("<<"("<<a<<"-"<<b<<")"<<"+"<<"("<<c<<"+"<<d<<")"<<")"<<endl;break;}
                ans = ((a-(b+c))+d); if(ans == 10){cout<<"("<<"("<<a<<"-"<<"("<<b<<"+"<<c<<")"<<")"<<"+"<<d<<")"<<endl;break;}
                ans = (a-((b+c)+d)); if(ans == 10){cout<<"("<<a<<"-"<<"("<<"("<<b<<"+"<<c<<")"<<"+"<<d<<")"<<")"<<endl;break;}
                ans = (a-(b+(c+d))); if(ans == 10){cout<<"("<<a<<"-"<<"("<<b<<"+"<<"("<<c<<"+"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a-b)+c)*d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"-"<<b<<")"<<"+"<<c<<")"<<"*"<<d<<")"<<endl;break;}
                ans = ((a-b)+(c*d)); if(ans == 10){cout<<"("<<"("<<a<<"-"<<b<<")"<<"+"<<"("<<c<<"*"<<d<<")"<<")"<<endl;break;}
                ans = ((a-(b+c))*d); if(ans == 10){cout<<"("<<"("<<a<<"-"<<"("<<b<<"+"<<c<<")"<<")"<<"*"<<d<<")"<<endl;break;}
                ans = (a-((b+c)*d)); if(ans == 10){cout<<"("<<a<<"-"<<"("<<"("<<b<<"+"<<c<<")"<<"*"<<d<<")"<<")"<<endl;break;}
                ans = (a-(b+(c*d))); if(ans == 10){cout<<"("<<a<<"-"<<"("<<b<<"+"<<"("<<c<<"*"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a-b)+c)-d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"-"<<b<<")"<<"+"<<c<<")"<<"-"<<d<<")"<<endl;break;}
                ans = ((a-b)+(c-d)); if(ans == 10){cout<<"("<<"("<<a<<"-"<<b<<")"<<"+"<<"("<<c<<"-"<<d<<")"<<")"<<endl;break;}
                ans = ((a-(b+c))-d); if(ans == 10){cout<<"("<<"("<<a<<"-"<<"("<<b<<"+"<<c<<")"<<")"<<"-"<<d<<")"<<endl;break;}
                ans = (a-((b+c)-d)); if(ans == 10){cout<<"("<<a<<"-"<<"("<<"("<<b<<"+"<<c<<")"<<"-"<<d<<")"<<")"<<endl;break;}
                ans = (a-(b+(c-d))); if(ans == 10){cout<<"("<<a<<"-"<<"("<<b<<"+"<<"("<<c<<"-"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a-b)*c)+d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"-"<<b<<")"<<"*"<<c<<")"<<"+"<<d<<")"<<endl;break;}
                ans = ((a-b)*(c+d)); if(ans == 10){cout<<"("<<"("<<a<<"-"<<b<<")"<<"*"<<"("<<c<<"+"<<d<<")"<<")"<<endl;break;}
                ans = ((a-(b*c))+d); if(ans == 10){cout<<"("<<"("<<a<<"-"<<"("<<b<<"*"<<c<<")"<<")"<<"+"<<d<<")"<<endl;break;}
                ans = (a-((b*c)+d)); if(ans == 10){cout<<"("<<a<<"-"<<"("<<"("<<b<<"*"<<c<<")"<<"+"<<d<<")"<<")"<<endl;break;}
                ans = (a-(b*(c+d))); if(ans == 10){cout<<"("<<a<<"-"<<"("<<b<<"*"<<"("<<c<<"+"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a-b)*c)*d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"-"<<b<<")"<<"*"<<c<<")"<<"*"<<d<<")"<<endl;break;}
                ans = ((a-b)*(c*d)); if(ans == 10){cout<<"("<<"("<<a<<"-"<<b<<")"<<"*"<<"("<<c<<"*"<<d<<")"<<")"<<endl;break;}
                ans = ((a-(b*c))*d); if(ans == 10){cout<<"("<<"("<<a<<"-"<<"("<<b<<"*"<<c<<")"<<")"<<"*"<<d<<")"<<endl;break;}
                ans = (a-((b*c)*d)); if(ans == 10){cout<<"("<<a<<"-"<<"("<<"("<<b<<"*"<<c<<")"<<"*"<<d<<")"<<")"<<endl;break;}
                ans = (a-(b*(c*d))); if(ans == 10){cout<<"("<<a<<"-"<<"("<<b<<"*"<<"("<<c<<"*"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a-b)*c)-d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"-"<<b<<")"<<"*"<<c<<")"<<"-"<<d<<")"<<endl;break;}
                ans = ((a-b)*(c-d)); if(ans == 10){cout<<"("<<"("<<a<<"-"<<b<<")"<<"*"<<"("<<c<<"-"<<d<<")"<<")"<<endl;break;}
                ans = ((a-(b*c))-d); if(ans == 10){cout<<"("<<"("<<a<<"-"<<"("<<b<<"*"<<c<<")"<<")"<<"-"<<d<<")"<<endl;break;}
                ans = (a-((b*c)-d)); if(ans == 10){cout<<"("<<a<<"-"<<"("<<"("<<b<<"*"<<c<<")"<<"-"<<d<<")"<<")"<<endl;break;}
                ans = (a-(b*(c-d))); if(ans == 10){cout<<"("<<a<<"-"<<"("<<b<<"*"<<"("<<c<<"-"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a-b)-c)+d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"-"<<b<<")"<<"-"<<c<<")"<<"+"<<d<<")"<<endl;break;}
                ans = ((a-b)-(c+d)); if(ans == 10){cout<<"("<<"("<<a<<"-"<<b<<")"<<"-"<<"("<<c<<"+"<<d<<")"<<")"<<endl;break;}
                ans = ((a-(b-c))+d); if(ans == 10){cout<<"("<<"("<<a<<"-"<<"("<<b<<"-"<<c<<")"<<")"<<"+"<<d<<")"<<endl;break;}
                ans = (a-((b-c)+d)); if(ans == 10){cout<<"("<<a<<"-"<<"("<<"("<<b<<"-"<<c<<")"<<"+"<<d<<")"<<")"<<endl;break;}
                ans = (a-(b-(c+d))); if(ans == 10){cout<<"("<<a<<"-"<<"("<<b<<"-"<<"("<<c<<"+"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a-b)-c)*d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"-"<<b<<")"<<"-"<<c<<")"<<"*"<<d<<")"<<endl;break;}
                ans = ((a-b)-(c*d)); if(ans == 10){cout<<"("<<"("<<a<<"-"<<b<<")"<<"-"<<"("<<c<<"*"<<d<<")"<<")"<<endl;break;}
                ans = ((a-(b-c))*d); if(ans == 10){cout<<"("<<"("<<a<<"-"<<"("<<b<<"-"<<c<<")"<<")"<<"*"<<d<<")"<<endl;break;}
                ans = (a-((b-c)*d)); if(ans == 10){cout<<"("<<a<<"-"<<"("<<"("<<b<<"-"<<c<<")"<<"*"<<d<<")"<<")"<<endl;break;}
                ans = (a-(b-(c*d))); if(ans == 10){cout<<"("<<a<<"-"<<"("<<b<<"-"<<"("<<c<<"*"<<d<<")"<<")"<<")"<<endl;break;}
                ans = (((a-b)-c)-d); if(ans == 10){cout<<"("<<"("<<"("<<a<<"-"<<b<<")"<<"-"<<c<<")"<<"-"<<d<<")"<<endl;break;}
                ans = ((a-b)-(c-d)); if(ans == 10){cout<<"("<<"("<<a<<"-"<<b<<")"<<"-"<<"("<<c<<"-"<<d<<")"<<")"<<endl;break;}
                ans = ((a-(b-c))-d); if(ans == 10){cout<<"("<<"("<<a<<"-"<<"("<<b<<"-"<<c<<")"<<")"<<"-"<<d<<")"<<endl;break;}
                ans = (a-((b-c)-d)); if(ans == 10){cout<<"("<<a<<"-"<<"("<<"("<<b<<"-"<<c<<")"<<"-"<<d<<")"<<")"<<endl;break;}
                ans = (a-(b-(c-d))); if(ans == 10){cout<<"("<<a<<"-"<<"("<<b<<"-"<<"("<<c<<"-"<<d<<")"<<")"<<")"<<endl;break;}
             
            }while(next_permutation(num, num+4));
            if(ans!=10){
                cout<<"0"<<endl;
            }
        }
        
    }
    
    
    return 0;
}