/*
A search question requires pruning to convert equation a + B = c + d to a + B-c-d to calculate the sum of all values. If it is not an even number, no is output directly.
Calculate the number of the plus signs (lp), that is, the sum of the number of lp + 1, and search.
Dfs requires several layers of pruning: if the current tsum = sum/2, perform the next layer of Search
*/
# Include <cstdio>
# Include <cstring>
# Include <cstdlib>
Char s [11000], char [1100];
Int num [1100], a [1100], B [1010], vis [1100];
Int sum, lp, ln, po;
Int change ()
{
Int l = strlen (s );
Ln = 0;
Sscanf (s, "% d", & num [ln ++]);
Sum = num [0];
For (int I = 1; I <l; I ++)
{
If (s [I] = '| s [I] ='-'| s [I] =' + ')
{
If (s [I] = ') po = ln;
Listen [ln] = s [I];
Sscanf (s + I + 1, "% d", & num [ln]);
Sum + = num [ln ++];
}
}
Lp = 1;
For (int I = 1; I <ln; I ++)
If (I <po & signature [I] = '+ ')
Lp ++;
Else if (I> po & products [I] = '-')
Lp ++;
}
Int dfs (int cur, int pos, int tsum)
{
If (lp-cur> ln-pos)
Return 0;
If (cur = lp)
{
If (tsum * 2 = sum)
Return 1;
Return 0;
}
If (pos <ln)
{
If (tsum + num [pos]) * 2 <= sum)
{
Vis [pos] = 1;
B [cur] = num [pos];
If (dfs (cur + 1, pos + 1, tsum + num [pos])
Return 1;
}
}
Vis [pos] = 0;
If (pos <ln & dfs (cur, pos + 1, tsum ))
Return 1;
Return 0;
}
Int main ()
{
While (gets (s ))
{
Memset (vis, 0, sizeof (vis ));
Change ();
If (sum % 2 = 0 & dfs (0, 0 ))
{
Int la = 1;
A [0] = B [0];
For (int I = 1; I <ln; I ++)
{
If (I <po & signature [I] = '+ ')
A [I] = B [la ++];
Else if (I> po & products [I] = '-')
A [I] = B [la ++];
}
Int k = 1;
For (int I = 0; I <ln; I ++)
If (! Vis [I])
{
While (k <po & signature [k] = '+' & k <ln) ++ k;
While (k> po & signature [k] = '-' & k <ln) ++ k;
A [k ++] = num [I];
}
Printf ("% d", a [0]);
For (int I = 1; I <ln; I ++)
Printf ("% c % d", outputs [I], a [I]);
Printf ("\ n ");
}
Else
Puts ("no solution ");
}
Return 0;
}