#include <cstdio>
#include <cctype>
#include <algorithm>

#define N 4

static
const char c[ ] = { '+', '-', '*' };

using namespace std;

static
int eval_expr (
  const char ** e
  );

static
int eval_term (
  const char ** e
  )
{
  int res;

  while ( isspace ( **e ) ) ++( *e );

  if ( **e == '(' )
  {
    ++( *e );
    res = eval_expr ( e );
    ++( *e );
  }
  else
  {
    res = *( ( *e )++ ) - '0';
  }

  return ( res );
}

static
int eval_expr (
  const char ** e
  )
{
  int res = eval_term ( e );

  while ( isspace ( **e ) ) ++( *e );

  switch ( *( ( *e )++ ) )
  {
    case '+': res += eval_term ( e ); break;
    case '-': res -= eval_term ( e ); break;
    case '*': res *= eval_term ( e ); break;
  }

  return ( res );
}

static
int eval (
  const char  * e
  )
{
  return
  eval_term ( &e );
}

/** Application main entry point. */
int main (
  int     argc,
  char  * argv[ ]
  )
{
  for ( ; ; )
  {
    int d[ N ];

CONTT:
    scanf ( "%d%d%d%d"
          , d, d + 1, d + 2, d + 3 );
    if ( !( d[ 0 ] | d[ 1 ] | d[ 2 ] | d[ 3 ] ) ) break ;

    sort ( d, d + N );
    do
    {
      int o[ 3 ];

      for ( o[ 0 ] = 0; o[ 0 ] < 3; ++o[ 0 ] )
      for ( o[ 1 ] = 0; o[ 1 ] < 3; ++o[ 1 ] )
      for ( o[ 2 ] = 0; o[ 2 ] < 3; ++o[ 2 ] )
      {
        char  expr[ 32 ];

        sprintf ( expr, "(((%d %c %d) %c %d) %c %d)", d[ 0 ]
                      , c[ o[ 0 ] ], d[ 1 ], c[ o[ 1 ] ]
                      , d[ 2 ], c[ o[ 2 ] ], d[ 3 ] );
        if ( eval ( expr ) == 10 )
        {
          puts ( expr );
          goto CONTT;
        }
        sprintf ( expr, "((%d %c (%d %c %d)) %c %d)", d[ 0 ]
                      , c[ o[ 0 ] ], d[ 1 ], c[ o[ 1 ] ]
                      , d[ 2 ], c[ o[ 2 ] ], d[ 3 ] );
        if ( eval ( expr ) == 10 )
        {
          puts ( expr );
          goto CONTT;
        }
        sprintf ( expr, "(%d %c ((%d %c %d) %c %d))", d[ 0 ]
                      , c[ o[ 0 ] ], d[ 1 ], c[ o[ 1 ] ]
                      , d[ 2 ], c[ o[ 2 ] ], d[ 3 ] );
        if ( eval ( expr ) == 10 )
        {
          puts ( expr );
          goto CONTT;
        }
        sprintf ( expr, "(%d %c (%d %c (%d %c %d))", d[ 0 ]
                      , c[ o[ 0 ] ], d[ 1 ], c[ o[ 1 ] ]
                      , d[ 2 ], c[ o[ 2 ] ], d[ 3 ] );
        if ( eval ( expr ) == 10 )
        {
          puts ( expr );
          goto CONTT;
        }
        sprintf ( expr, "((%d %c %d) %c (%d %c %d))", d[ 0 ]
                      , c[ o[ 0 ] ], d[ 1 ], c[ o[ 1 ] ]
                      , d[ 2 ], c[ o[ 2 ] ], d[ 3 ] );
        if ( eval ( expr ) == 10 )
        {
          puts ( expr );
          goto CONTT;
        }
      }
    }
    while ( next_permutation ( d, d + N ) ) ;

    puts ( "0" );
  }

  return ( 0 );
}