#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int a[4];
int solve(){
    int b[4];
    int t[4];
    int u[4];
    int i[3];
    char o[3];
    for(b[0]=0;b[0]<4;b[0]++){
        for(b[1]=0;b[1]<4;b[1]++){
            if(b[1]==b[0]) continue;
            for(b[2]=0;b[2]<4;b[2]++){
                if(b[2]==b[0] || b[2]==b[1]) continue;
                for(b[3]=0;b[3]<4;b[3]++){
                    if(b[3]==b[0] || b[3]==b[1] || b[3]==b[2]) continue;
                    for(i[0]=0;i[0]<3;i[0]++){
                        for(i[1]=0;i[1]<3;i[1]++){
                            for(i[2]=0;i[2]<3;i[2]++){
                                t[0] = a[b[0]];
                                for(int j=0;j<3;j++){
                                    if(i[j]==0){
                                        t[j+1] = t[j] - a[b[j+1]];
                                        o[j] = '-';
                                        if(j==0) u[j] = a[b[j]] - a[b[j+1]];
                                        else if(j==1) u[j] = a[b[j+1]] - a[b[j+2]];
                                        else u[j] = u[0] - u[1];
                                    }else if(i[j]==1){
                                        t[j+1] = t[j] + a[b[j+1]];
                                        o[j] = '+';
                                        if(j==0) u[j] = a[b[j]] + a[b[j+1]];
                                        else if(j==1) u[j] = a[b[j+1]] + a[b[j+2]];
                                        else u[j] = u[0] + u[1];
                                    }else{
                                        t[j+1] = t[j] * a[b[j+1]];
                                        o[j] = '*';
                                        if(j==0) u[j] = a[b[j]] * a[b[j+1]];
                                        else if(j==1) u[j] = a[b[j+1]] * a[b[j+2]];
                                        else u[j] = u[0] * u[1];
                                    }
                                }
                                if(t[3]==10){
                                    cout << "(((";
                                    cout << a[b[0]] << ' ' << o[0] << ' ' << a[b[1]] << ')'; 
                                    cout << ' ' << o[1] << ' ' << a[b[2]] << ')'; 
                                    cout << ' ' << o[2] << ' ' << a[b[3]] << ')' << endl;
                                    return 0;
                                }else if(u[2]==10){
                                    cout << "((" << a[b[0]] << ' ' << o[0] << ' ' << a[b[1]] << ')';
                                    cout << ' ' << o[2] << ' ';
                                    cout << '(' << a[b[2]] << ' ' << o[0] << ' ' << a[b[3]] << "))" << endl;
                                    return 0;
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    cout << 0 << endl;
}

                        

int main(){
    cin >> a[0] >> a[1] >> a[2] >> a[3];
    while(a[0]||a[1]||a[2]||a[3]){
        solve();
        cin >> a[0] >> a[1] >> a[2] >> a[3];
    }
}