Lottery

No attempts yetTime limit1sMemory limit128 MB

Problem

You have just won the lottery. All that separates you from your multi-million dollar prize is your correct answer to the following skill-testing question:

$1234 + 4567 \times 11$

With only twenty seconds on the clock, you feel your fortune slipping away because you cannot tell whether the answer is

$(1234 + 4567) \times 11 = 63,811$

or

$1234 + (4567 \times 11) = 51,471$

You guess 63811, but that answer is wrong. The question expects you to remember that multiplication is performed before addition, so the correct answer is 51471.

Your job is to write a program that inserts parentheses into questions like the one above so that the order of operations is made explicit.

Input

The first line of input contains an integer $n$. Each of the next $n$ lines contains one expression made up of integers and the operators +, -, and X, denoting addition, subtraction, and multiplication respectively. Adjacent integers are separated by exactly one operator. There is a single space to the left and to the right of every operator, and no input line contains more than 80 characters.

Output

Output the same $n$ expressions, one per line and separated by a blank line, with parentheses inserted so that the order of operations is explicit. Multiplication is applied first, from left to right, and then addition and subtraction are applied, also from left to right. Preserve the spaces surrounding every operator.