#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <cmath>
#include <random>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define ALL(v) v.begin(), v.end()

// every calculation can be written
// ((a ? b) ? c) ? d  or  (a ? b) ? (c ? d)

int calc(int a, int b, char ope) {
    if (ope == '+') return a + b;
    if (ope == '-') return a - b;
    if (ope == '*') return a * b;
    return -1;
}

bool isten(string s) {
    int ans;
    if (s[1] == '(') {
        int a, b, c, d;
        a = s[2] - '0';
        b = s[6] - '0';
        c = s[11] - '0';
        d = s[16] - '0';
        ans = calc(calc(calc(a,b,s[4]), c, s[9]), d, s[14]);
    }else {
        int a, b, c, d;
        a = s[1] - '0';
        b = s[5] - '0';
        c = s[11] - '0';
        d = s[15] - '0';
        ans = calc(calc(a, b, s[3]), calc(c, d, s[13]), s[8]);
    }
    return ans == 10;
}

// every calculation can be written
// ((a ? b) ? c) ? d  or  (a ? b) ? (c ? d)


vector<char> operands = {'+', '-', '*'};
random_device rd;

char getRandomOperand() {
    return operands[rd() % 3];
}

void solve41(int a, int b, int c, int d) {
    vector<int> nums;
    nums.push_back(a), nums.push_back(b), nums.push_back(c), nums.push_back(d);
    sort(ALL(nums));
    do {
        REP(i,100) {
            string eq1, eq2;
            eq1 = "((" + to_string(nums[0]) + " " + getRandomOperand() + " " +
            to_string(nums[1]) + ") " + getRandomOperand() + " " + to_string(nums[2]) +
            ") " + getRandomOperand() + " " + to_string(nums[3]);
            eq2 = "(" + to_string(nums[0]) + " " + getRandomOperand() + " " +
            to_string(nums[1]) + ") " + getRandomOperand() + " (" + to_string(nums[2]) +
            " " + getRandomOperand() + " " + to_string(nums[3]) + ")";
            if (isten(eq1)) {
                cout << eq1 << endl;
                return;
            }else if (isten(eq2)) {
                cout << eq2 << endl;
                return;
            }
        }
    }while (next_permutation(nums.begin(), nums.end()));
    cout << 0 << endl;
}

int main() {
    int a, b, c, d;
    while(cin >> a >> b >> c >> d, a + b + c + d) {
        solve41(a,b,c,d);
    }
    return 0;
}