#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int ope(int a, int b, int i){
    if(i == 0)
        return a + b;
    else if(i == 1)
        return a - b;
    else
        return a * b;
}

void solve(vector<int> a)
{
    char c[] = {'+', '-', '*'};

    do{
        for(int i=0; i<3; ++i){
            for(int j=0; j<3; ++j){
                for(int k=0; k<3; ++k){
                    if(ope(ope(a[0], a[1], i), ope(a[2], a[3], j), k) == 10){
                        cout << "((" << a[0] << c[i] << a[1] << ')' << c[k] << '(' << a[2] << c[j] << a[3] << "))" << endl;
                        return;
                    }
                    if(ope(ope(ope(a[0], a[1], i), a[2], j), a[3], k) == 10){
                        cout << "(((" << a[0] << c[i] << a[1] << ')' << c[j] << a[2] << ')' << c[k] << a[3] << ')' << endl;
                        return;
                    }
                    if(ope(ope(a[0], ope(a[1], a[2], i), j), a[3], k) == 10){
                        cout << "((" << a[0] << c[j] << '(' << a[1] << c[i] << a[2] << "))" << c[k] << a[3] << ')' << endl;
                        return;
                    }
                    if(ope(a[0], ope(ope(a[1], a[2], i), a[3], j), k) == 10){
                        cout << '(' << a[0] << c[k] << "((" << a[1] << c[i] << a[2] << ')' << c[j] << a[3] << "))" << endl;
                    }
                }
            }
        }
    }while(next_permutation(a.begin(), a.end()));

    cout << '0' << endl;
}

int main()
{
    for(;;){
        vector<int> a(4);
        for(int i=0; i<4; ++i){
            cin >> a[i];
            if(a[i] == 0)
                return 0;
        }
        sort(a.begin(), a.end());

        solve(a);
    }
}