#include <cstdio>
#include <algorithm>
using namespace std;

int add(int a, int b) {return a+b;}
int sub(int a, int b) {return a-b;}
int mul(int a, int b) {return a*b;}

int ps[4];
int (*op[3])(int, int) = {add, sub, mul};
char ops[] = {'+', '-', '*'};

void solve() {
  sort(ps, ps+4);
  do {
    for (int i=0; i<3; i++) {
      for (int j=0; j<3; j++) {
        for (int k=0; k<3; k++) {
          int res;

          res = op[k](op[j](op[i](ps[0], ps[1]), ps[2]), ps[3]);
          if (res == 10) {
            printf("(((%d%c%d)%c%d)%c%d)\n", ps[0], ops[i], ps[1], ops[j], ps[2], ops[k], ps[3]);
            return;
          }

          res = op[k](op[i](ps[0], ps[1]), op[j](ps[2], ps[3]));
          if (res == 10) {
            printf("((%d%c%d)%c(%d%c%d))\n", ps[0], ops[i], ps[1], ops[k], ps[2], ops[j], ps[3]);
            return;
          }
        }
      }
    }
  } while (next_permutation(ps, ps+4));
  puts("0");
}

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

    if ((ps[0] | ps[1] | ps[2] | ps[3]) == 0) return 0;
    solve();
  }
}