#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
using namespace std;

struct D {
  int n;
  string s;

  D() {
  }

  D(const D &obj) {
    this->n = obj.n;
    this->s = obj.s;
  }

  D &operator=(const D &obj) {
    this->n = obj.n;
    this->s = obj.s;
  }
};

std::ostream &operator<< (std::ostream &out, const D &obj) {
  out << obj.s;
  return out;
}

D buf4[4];
D buf3[3];
D buf2[2];

D op(int x, D l, D r) {
  D tmp;
  switch (x) {
    case 0:
      tmp.n = l.n + r.n;
      tmp.s = "(" + l.s + "+" + r.s + ")";
      break;
    case 1:
      tmp.n = l.n * r.n;
      tmp.s = "(" + l.s + "*" + r.s + ")";
      break;
    case 2:
      tmp.n = l.n - r.n;
      tmp.s = "(" + l.s + "-" + r.s + ")";
      break;
  }
  return tmp;
}

int main() {
  int a[4], x;
  bool flg;
  D ans;
  while (1) {
    scanf("%d %d %d %d", &a[0], &a[1], &a[2], &a[3]);
    if (!a[0] && !a[1] && !a[2] && !a[3]) break;

    for (int i=0; i<4; i++) {
      buf4[i].n = a[i];
      buf4[i].s = "";
      buf4[i].s += (char)('0' + a[i]);
    }
    flg = false;
    for (int i=0; i<4; i++) {
      for (int j=0; j<4; j++) {
        if (i==j) continue;
        x = 0;
        for (int y=0; y<4; y++) {
          if (y!=i && y!= j) {
            buf3[x++] = buf4[y];
          }
        }
        for (int k=0; k<3; k++) {
          buf3[2] = op(k, buf4[i], buf4[j]);
          for (int l=0; l<3; l++) {
            buf2[0] = buf3[l];
            for (int m=0; m<3; m++) {
              buf2[1] = op(m, buf3[(l+1)%3], buf3[(l+2)%3]);
              for (int n=0; n<3; n++) {
                ans = op(n, buf2[0], buf2[1]);
                if (ans.n == 10) {
                  flg = true;
                  break;
                }
                ans = op(n ,buf2[1], buf2[0]);
                if (ans.n == 10) {
                  flg = true;
                  break;
                }
              }
              if (flg) break;
              buf2[1] = op(m, buf3[(l+2)%3], buf3[(l+1)%3]);
              for (int n=0; n<3; n++) {
                ans = op(n, buf2[0], buf2[1]);
                if (ans.n == 10) {
                  flg = true;
                  break;
                }
                ans = op(n ,buf2[1], buf2[0]);
                if (ans.n == 10) {
                  flg = true;
                  break;
                }
              }
              if (flg) break;
            }
            if (flg) break;
          }
          if (flg) break;
        }
        if (flg) break;
      }
      if (flg) break;
    }
    if (ans.n == 10) {
      printf("%s\n", ans.s.c_str());
    } else {
      printf("0\n");
    }

  }

  return 0;
}