#include <bits/stdc++.h>

using namespace std;

struct Comb { int id, op[3]; };
const string ord = "+-*";

int func(int a, int b, int i) {
    switch (i) {
        case 0: return a + b;
        case 1: return a - b;
        case 2: return a * b;
    }
}

Comb treeRank3(int a[]) {
    Comb res;
    res.id = -1;

    for (int i = 0; i < 27; i++) {
        int calc = a[0], p = i;

        for (int j = 1; j <= 3; j++) {
            res.op[j - 1] = p % 3;
            calc = func(calc, a[j], res.op[j - 1]);
            p /= 3;
        }

        if (calc == 10) {
            res.id = i;
            return res;
        }
    }
    return res;
}

Comb treeRank2(int a[]) {
    Comb res;
    res.id = -1;

    for (int i = 0; i < 27; i++) {
        int p = i;
        for (int j = 0; j < 3; j++) {
            res.op[j] = p % 3;
            p /= 3;
        }

        int calc = func(func(a[0], a[1], res.op[0]),
                        func(a[2], a[3], res.op[1]), res.op[2]);
        if (calc == 10) {
            res.id = i;
            return res;
        }
    }
    return res;
}

void solve(int a[]) {
    sort(a, a + 4);

    do {
        Comb ans = treeRank3(a);
        if (ans.id != -1) {
            printf("(((%d %c %d) %c %d) %c %d)\n", a[0], ord[ans.op[0]],
                                                   a[1], ord[ans.op[1]],
                                                   a[2], ord[ans.op[2]], a[3]);
            return;
        }

        ans = treeRank2(a);
        if (ans.id != -1) {
            printf("((%d %c %d) %c (%d %c %d))\n", a[0], ord[ans.op[0]],
                                                   a[1], ord[ans.op[2]],
                                                   a[2], ord[ans.op[1]], a[3]);
            return;
        }
    } while (next_permutation(a, a + 4));

    puts("0");
}

int main() {
    int a[4];
    while (scanf("%d", &a[0]), a[0]) {
        for (int i = 1; i < 4; i++)
            scanf("%d", &a[i]);

        solve(a);
    }

    return 0;
}
