#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); ++i)

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

const string op = "+-*";
int main() {
    int a[4];
    while (cin>>a[0]>>a[1]>>a[2]>>a[3], a[0]) {
        do {
            rep(i,3) rep(j,3) rep(k,3) {
                if (calc(calc(calc(a[0], op[i], a[1]), op[j], a[2]), op[k], a[3]) == 10) {
                    cout << "((" + to_string(a[0]) + op[i] + to_string(a[1]) + ")" + op[j] + to_string(a[2]) + ")" + op[k] + to_string(a[3]) << endl;
                    goto end;
                }
                if (calc(calc(a[0], op[i], a[1]), op[j], calc(a[2], op[k], a[3])) == 10) {
                    cout << "(" + to_string(a[0]) + op[i] + to_string(a[1]) + ")" + op[j] + "(" + to_string(a[2]) + op[k] + to_string(a[3]) + ")" << endl;
                    goto end;
                }
            }
        } while (next_permutation(a, a+4));
        cout << "0" << endl;
        end:;
    }
    return 0;
}