#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int f(int a, int b, int c){
    switch(c){
        case 0:
            return a+b;
        case 1:
            return a*b;
        case 2:
            return a-b;
        default:
            return a+b;
    }
}

char g(int a){
    switch(a){
        case 0:
            return '+';
        case 1:
            return '*';
        case 2:
            return '-';
        default:
            return '+';
    }
}

int main(void){
    vector<int> num(4);
    int flag = 0;

    cin >> num[0] >> num[1] >> num[2] >> num[3];
    while(num[0] + num[1] + num[2] + num[3] != 0){
        flag = 0;
        do{
            for(int i = 0;i < 3 && !flag;i++){
                for(int j = 0;j < 3 && !flag;j++){
                    for(int k = 0;k < 3 && !flag;k++){
                        if(f(f(f(num[0], num[1], i), num[2], j), num[3], k) == 10){
                            cout << "((" << num[0] << " " << g(i) << " " << num[1] << ") " << g(j) << " " << num[2] << ") " << g(k) << " " << num[3] << endl;
                            flag = 1;
                        }else if(f(f(num[0], f(num[1], num[2], j), i), num[3], k) == 10){
                            cout << "(" << num[0] << " " << g(i) << " (" << num[1] << " " << g(j) << " " << num[2] << ")) " << g(k) << " " << num[3] << endl;
                            flag = 1;
                        }else if(f(num[0], f(f(num[1], num[2], j), num[3], k), i) == 10){
                            cout << num[0] << " " << g(i) << " ((" << num[1] << " " << g(j) << " " << num[2] << ") " << g(k) << " " << num[3] << ")" << endl;
                            flag = 1;
                        }else if(f(num[0], f(num[1], f(num[2], num[3], k), j), i) == 10){
                            cout << num[0] << " " << g(i) << " (" << num[1] << " " << g(j) << " (" << num[2] << " " << g(k) << " " << num[3] << "))" << endl;
                            flag = 1;
                        }else if(f(f(num[0], num[1], i), f(num[2], num[3], k), j) == 10){
                            cout << "(" << num[0] << " " << g(i) << " " << num[1] << ") " << g(j) << " (" << num[2] << " " << g(k) << " " << num[3] << ")" << endl;
                            flag = 1;
                        }
                    }
                }
            }
        }while(next_permutation(num.begin(), num.end()) && !flag);
        if(flag == 0)
            cout << 0 << endl;
        cin >> num[0] >> num[1] >> num[2] >> num[3];
    }

    return 0;
}
    