1 + 2 = 4 - 5 + 6is not a correct equation but the terms can be rearranged thus so it is:
6 + 2 = 4 - 1 + 5Standard input consists of several pseudo-equations, one per line. Each pseudo-equation has up to 16 integer terms. Adjacent terms are separated by one operator, and spaces may appear surrounding the terms. There is exactly one = operator in the equation.
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 no ordering exists, a line containing
no solutionshould be printed. One space should appear on either side of each operator and there should be no other spaces.
1 + 2 = 4 - 5 + 6 111 + 222 = 444 - 555 + 665
6 + 2 = 4 - 1 + 5 no solution