Four Fours

No attempts yetTime limit2sMemory limit256 MB

Problem

Given an integer nn, build one expression whose value is nn. The expression uses the digit 4 exactly four times, with exactly three binary operators chosen from *, +, -, / placed between them. The digit 4 is the only number you may use. Joining fours into a larger number such as 44 or 444 is not allowed.

Division is integer division that truncates toward zero, so 4 / 4 / 4 is 0 and not 0.25. Operators keep their usual precedence, so 4 + 4 * 4 is 20 and not 32.

Only 64 expressions fit these rules, so some values of nn cannot be reached by any of them. For example, no expression gives n=11n = 11.

Input

The first line contains the number of test cases mm. (1m10001 \le m \le 1000)

Each of the next mm lines contains one integer nn. (1000000n1000000-1000000 \le n \le 1000000)

Output

Print one line for each test case.

If an expression whose value is nn exists, print it in the form 4 * 4 - 4 * 4 = 0, with a single space between every number, operator, and the equals sign. If no such expression exists, print no solution.

If several expressions have the value nn, print only the one whose printed string comes first in lexicographic order. The four fours are identical, so this is the same as comparing the three operators from left to right under the order *, +, -, /.

Hint

There are three operator slots and four candidates for each slot, so only 64 expressions exist. Evaluate all 64 once and store, for each value, the expression that comes first in lexicographic order. Every test case then costs one table lookup.