import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;

int solve(int a, int b, int c) {
  if (c == 0) return a + b;
  if (c == 1) return a - b;
  return a * b;
}

void main()
{
  auto op = ['+', '-', '*'];
	a:while (1) {
    auto x = readln.chomp.split.map!(to!int).array;
    x = x.sort.array;
    if (!x[0]) break;

    foreach (l; 0..4) {
    foreach (m; 0..4) {
    if (l == m) continue;
    foreach (n; 0..4) {
    if (l == n || m == n) continue;
    foreach (o; 0..4) {
    if (l == o || m == o || n == o) continue;

      auto a = x[l], b = x[m], c = x[n], d = x[o];
      foreach (i; 0..3) {
        foreach (j; 0..3) {
          foreach (k; 0..3) {
            auto res1 = solve(solve(solve(a,b,i),c,j),d,k);
            if (res1 == 10) {
              writefln("(((%d%c%d)%c%d)%c%d)",a,op[i],b,op[j],c,op[k],d);
              continue a;
            } 
            auto res2 = solve(solve(a,b,i),solve(c,d,k),j);
            if (res2 == 10) {
              writefln("(((%d%c%d)%c(%d%c%d))",a,op[i],b,op[j],c,op[k],d);
              continue a;
            } 
          }
        }
      }
    }}}} 
    writeln("0");
  }
}