#include <iostream>
#include <functional>
#include <algorithm>

using namespace std;
#define loop(i,a,b) for(int i=(a); i<(b); i++)
#define rep(i,n) loop(i,0,n)

const function<int(int,int)>
(&fs)[]={plus<int>(),
         minus<int>(),
         multiplies<int>()};
char op[]="+-*";
int fidx[]={0,1,2};

int a[4];

int main(){
    while(1){
        rep(i,4)cin>>a[i];
        if(accumulate(a,a+4,0)==0) break;
        bool ok=false;
        sort(a,a+4);
        rep(i,3)rep(j,3)rep(k,3){
            do{
                int ans=fs[k](fs[j](fs[i](a[0],a[1]),a[2]),a[3]);
                if(ans==10){
                    cout<<"((("
                        <<a[0]<<op[i]
                        <<a[1]<<")"<<op[j]
                        <<a[2]<<")"<<op[k]
                        <<a[3]<<")"
                        <<endl;
                    ok=1;
                    goto end;
                }
                ans=fs[k](fs[i](a[0],a[1]),fs[j](a[2],a[3]));
                if(ans==10){
                    cout<<"("
                        <<a[0]<<op[i]<<a[1]
                        <<")"<<op[k]<<"("
                        <<a[2]<<op[j]<<a[3]
                        <<")"
                        <<endl;
                    ok=1;
                    goto end;
                }
            }while(next_permutation(a,a+4));
        }
    end:;
        if(!ok) cout<<0<<endl;
    }
}