#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> P;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
int calc(int a,int b,int n){
  if(n==0) return a+b;
  if(n==1) return a-b;
  return a*b;
}
char enzansi(int n){
  if(n==0) return '+';
  if(n==1) return '-';
  if(n==2) return '*';
}
string siki(string i,string j,int n){
  string enzan = "+";
  enzan = enzansi(n);
  string ret = "("+i+enzan+j+")";
  return ret;
}
string IntToString(int number)
{
  stringstream ss;
  ss << number;
  return ss.str();
}

int main(void){
  int a[4];
  while(cin>>a[0]>>a[1]>>a[2]>>a[3]){
    if(a[0]==0) break;
    for(int i=0;i<4;i++){
      for(int j=0;j<4;j++){
        if(i!=j){
          for(int k=0;k<3;k++){
            int e[3]; 
            e[0] = calc(a[i],a[j],k);
            for(int h=0,n=1;h<4;h++)if(h!=i&&h!=j)e[n++] = a[h];
            REP(l,3)REP(m,3)if(l!=m){
              for(int p=0; p<3; p++){
                int f[2];
                int g;
                f[0] = calc(e[l],e[m],p);
                REP(n,3)if(n!=l&&n!=m){
                  f[1]=e[n];
                  g = n;
                }
                REP(n,3){
                  if(calc(f[0],f[1],n)==10){
                    if(g==0){
                      string A = siki(IntToString(a[i]),IntToString(a[j]),k);
                      string B = siki(IntToString(e[l]),IntToString(e[m]),p);
                      cout<<siki(B,A,n)<<endl;
                    }else{
                      string A = siki(IntToString(a[i]),IntToString(a[j]),k);
                      string B;
                      if(l==0){
                        B = siki(A,IntToString(e[m]),p);
                      }else{
                        B = siki(IntToString(e[l]),A,p);
                      }
                      cout<<siki(B,IntToString(f[1]),n)<<endl;
                    } 
                    goto ENDDD;
                  }else if(calc(f[1],f[0],n)==10){
                    if(g==0){
                      string A = siki(IntToString(a[i]),IntToString(a[j]),k);
                      string B = siki(IntToString(e[l]),IntToString(e[m]),p);
                      cout<<siki(A,B,n)<<endl;
                    }else{
                      string A = siki(IntToString(a[i]),IntToString(a[j]),k);
                      string B;
                      if(l==0){
                        B = siki(A,IntToString(e[m]),p);
                      }else{
                        B = siki(IntToString(e[l]),A,p);
                      }
                      cout<<siki(IntToString(f[1]),B,n)<<endl;
                    } 
                    goto ENDDD;
                  }
                }
              }
            }
          }
        }
      }
    }
    cout<<0<<endl;
ENDDD:;
  }     
  return 0;
}