#include<iostream>
#include<sstream>
#include<vector>

using namespace std;

#define rep(i, n) for (int i = 0; i < int(n); ++i)

struct Num{
  Num() {}
  Num(int n) : n(n) {
    stringstream ss;
    ss << n;
    ss >> s;
  }
  int n;
  string s;
};

string ope[] = {"+", "-", "*"};

Num calc(Num a, Num b, int k) {
  Num num;
  switch (k) {
  case 0: num.n = a.n + b.n; break;
  case 1: num.n = a.n - b.n; break;
  case 2: num.n = a.n * b.n; break;
  }
  num.s = "(" + a.s + " " + ope[k] + " " +b.s + ")";
  return num;
}

bool solve(vector<Num> v) {
  if (v.size() == 1u) {
    if (v[0].n == 10) {
      cout << v[0].s << endl;
      return true;
    }
    return false;
  }
  rep (i, v.size()) rep (j, v.size()) if (i != j) rep (k, 3) {
      vector<Num> next;
      next.push_back(calc(v[i], v[j], k));
      rep (l, v.size()) if (i != l && j != l) next.push_back(v[l]);
      if (solve(next)) return true;
    }
  return false;
}

int main() {
  while (true) {
    int a[4];
    rep (i, 4) cin >> a[i];
    if (a[0] == 0) break;
    vector<Num> v;
    rep (i, 4) v.push_back(a[i]);
    if (!solve(v)) {
      cout << 0 << endl;
    }
  }
  return 0;
}