Equating Equations

Read (incorrect) equations with up to 16 terms and ‘+’ and ‘-’ operators and reorder the terms (but not the operators) so that the equations hold. For example 1+2=4-5+6 is not a correct equation but the terms can be rearranged thus so it is: 6+2=4-1+5 Input Standard input consists of several pseudo-equations, one per line. Each pseudo-equation has up to 16 integer terms and each term is less than 100. Adjacent terms are separated by one operator, and spaces may appear surrounding the terms. There is exactly one ‘=’ operator in the equation. Output Your output will consist of one line per input line, with the same operators and the same terms. The order of the operators must be preserved, but the terms must be reordered so the equation holds. Any ordering such that the equation holds is correct. If there is more than one ordering any one of the orderings will do. If no ordering exists, a line containing no solution should be printed. One space should appear on either side of each operator and there should be no other spaces. Sample Input 1+2=4-5+6 1+5=6+7 Sample Output 6+2=4-1+5 no solution