#include<vector>
#include<map>
#include<climits>
#include<set>
#include<queue>
#include<algorithm>
#include<functional>
#include<numeric>
#include<utility>
#include<sstream>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cctype>
#include<string>
#include<bitset>
#include<cstring>
#include<list>
using namespace std;
typedef vector<int>VI;
typedef vector<VI>VVI;
typedef vector<string>VS;
typedef pair<int,int>PII;
typedef long long LL;
typedef pair<LL,LL>PLL;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define PB push_back
#define EACH(i,c) for(typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define F first
#define S second

typedef string::const_iterator State;

int Number(State &Begin){
    int ret=0;
    while(isdigit(*Begin)){
        ret*=10;
        ret+=(*Begin)-'0';
        Begin++;
    }

    return ret;
}
int Expression(State&);
int Factor(State &Begin){
    if(*Begin=='('){
        Begin++;
        int ret=Expression(Begin);
        Begin++;
        return ret;
    }
    else return Number(Begin);
}

int Term(State &Begin){
    int ret=Factor(Begin);
    while(true){
        if(*Begin=='*'){
            Begin++;
            ret*=Factor(Begin);
        }
        else if(*Begin=='/'){
            Begin++;
            ret/=Factor(Begin);
        }
        else break;
    }
    return ret;
}

int Expression(State &Begin){
    int ret=Term(Begin);
    while(true){
        if(*Begin=='+'){
            Begin++;
            ret+=Term(Begin);
        }
        else if(*Begin=='-'){
            Begin++;
            ret-=Term(Begin);
        }
        else break;
    }
    return ret;
}
string temp[]={
    "(X?X)?(X?X)=",
    "(X?X)?X?X=",
    "(X?X?X)?X=",
    "((X?X)?X)?X=",
};
char op[]={'+','-','*',};
int main(){
    int perm[4];
    while(true){
        REP(i,4)cin>>perm[i];
        bool flag=false;
        REP(i,4)if(perm[i])flag=true;
        if(!flag)break;
        int cnt=0;
        sort(perm,perm+4);
        flag=false;
        do{
            REP(i,3)REP(j,3)REP(k,3){
                if(flag)break;
                REP(l,4){
                    string str=temp[l];
                    str[str.find('?')]=op[i];
                    str[str.find('?')]=op[j];
                    str[str.find('?')]=op[k];
                    REP(x,4)str[str.find('X')]=(char)(perm[x]+'0');
                    State Begin=str.begin();
                    if(Expression(Begin)==10){
                        str=str.substr(0,str.size()-1);
                        cout<<str<<endl;
                        flag=true;
                        break;
                    }
                }
            }
            if(flag)break;
        }while(next_permutation(perm,perm+4));
        if(!flag)cout<<0<<endl;
    }
    return 0;
}