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

const string op = "+-*";

string S(int x) {
    stringstream ss;
    ss << x;
    return ss.str();
}

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

string solve(vector<int> a) {
    sort(a.begin(), a.end());
    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) {
                return "((" + S(a[0]) + " " + op[i] + " " + S(a[1]) + ")" + " " + op[j] + " " + S(a[2]) + ")" + " " + op[k] + " " + S(a[3]);
            }
            if (calc(calc(a[0], op[i], a[1]), op[j], calc(a[2], op[k], a[3])) == 10) {
                return "(" + S(a[0]) + " " + op[i] + " " + S(a[1]) + ")" + " " + op[j] + " " + "(" + S(a[2]) + " " + op[k] + " " + S(a[3]) + ")";
            }
        }
    } while (next_permutation(a.begin(), a.end()));
    return "0";
}

int main() {
    vector<int> a(4);
    while (cin >> a[0] >> a[1] >> a[2] >> a[3], a[0]) {
        cout << solve(a) << endl;
    }
    return 0;
}