#include <bits/stdc++.h>

using namespace std;

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

bool search(vector<int> &a)
{
    string op = "+-*";
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            for (int k = 0; k < 3; k++) {
                if (calc(calc(a[0], op[i], calc(a[1], op[j], a[2])), op[k], a[3]) == 10) {
                    printf("((%d %c (%d %c %d)) %c %d)\n"
                           ,a[0], op[i], a[1], op[j], a[2], op[k], a[3]);
                    return 1;
                }
                if (calc(calc(a[0], op[i], calc(a[1], op[j], a[2])), op[k], a[3]) == 10) {
                    printf("(%d %c (%d %c %d) %c %d)\n"
                           ,a[0], op[i], a[1], op[j], a[2], op[k], a[3]);
                    return 1;
                } 
                if (calc(calc(a[0], op[i], a[1]), op[j], calc(a[2], op[k], a[3])) == 10) {
                    printf("((%d %c %d) %c (%d %c %d))\n"
                           ,a[0], op[i], a[1], op[j], a[2], op[k], a[3]);
                    return 1;
                }
            }
        }
    }
    return 0;
}

int main()
{
    vector<int> a(4);
    while (cin >> a[0] >> a[1] >> a[2] >> a[3], a[0]) {
        sort(a.begin(), a.end());
        
        bool found = 0;
        do {
            if (search(a)) {
                found = 1;
                break;
            }
        } while (next_permutation(a.begin(), a.end()));
        if (!found) {
            cout << 0 << endl;
        }
    }
    return 0;
}