#include <iostream>
#include <string>
#include <cctype>
#include <cstdlib>
#include <algorithm>
using namespace std;


string form;
int pos;
int exp();
int term();
int factor();


int factor() {
  int x;
  if(form[pos] == '(') {
    pos++;
    x =  exp();
    pos++;
  } else {
    int s = pos;
    int size = 0;
    while(isdigit(form[pos])) {
      pos++;
      size++;
    }
    string num = form.substr(s, size);
    x = atoi(num.c_str());
  }
  return x;
}

int term() {
  int x = factor();
  while(form[pos] == '*' || form[pos] == '/') {
    if(form[pos] == '*') {
      pos++;
      x *= factor();
    } else {
      pos++;
      x /= factor();
    }
  }
  return x;
}

int exp() { 
  int x = term();
  while(form[pos] == '+' || form[pos] == '-') {
    if(form[pos] == '+') {
      pos++;
      x += term();
    } else {
      pos++;
      x -= term();
    }
  }
  return x;
}

int data[4];
bool found;

int getPos(int n) {
  int cnt = 0;
  for(int i = 0; i < form.length(); ++i) {
    if(isdigit(form[i])) {
      if(cnt == n) {
	return i;
      }
      cnt++;
    }
  }
  return 0;
}

void make(int s, int e) {
  int p;
  p = getPos(s);
  p--;
  while(p >= 0 && form[p] == '(') p--;
  p++;
  form.insert(p, "(");
  p = getPos(e);
  p++;
  while(p < form.length() && form[p] == ')') p++;
  form.insert(p, ")");
}

void solve3(int size) {
  if(size == 4) {
    pos = 0;
    if(exp() == 10) {
      cout << form << endl;
      found = true;
    }
    return;
  }

  string tmp = form;
  solve3(size+1);
  if(found) return;
  for(int i = 0; i+size-1 < 4; ++i) {
    form = tmp;
    make(i, i+size-1);
    solve3(size+1);
    if(found) break;
  }
  if(size == 2) {
    form = tmp;
    make(0, 1);
    make(2, 3);
    solve3(3);
  }
}

void solve2(int p) {
  if(p == 3) {
    string tmp = form;
    solve3(2);
    form = tmp;
    return;
  }
  if(found) return;
  form[p*2+1] = '+';
  solve2(p+1);
  if(found) return;
  form[p*2+1] = '-';
  solve2(p+1);
  if(found) return;
  form[p*2+1] = '*';
  solve2(p+1);
  if(found) return;
}

void solve() {
  found = false;
  sort(data, data+4);
  do {
    form = "";
    for(int i = 0; i < 4; ++i) {
      if(i != 0) form += '#';
      form += (char)(data[i] + '0');
    }
    solve2(0);
    if(found) {
      return;
    }
  } while(next_permutation(data, data+4));
  cout << 0 << endl;
}

main() {
  while(1) {
    bool flag = false;
    for(int i = 0; i < 4; ++i) {
      cin >> data[i];
      if(data[i] != 0) flag = true;
    }
    if(!flag) break;
    solve();
  }
}