An unnamed space agency, still mocked for its infamous metric/imperial unit-conversion blunder, vowed never to let that error happen again. Unfortunately, it over-hired struggling college students who are excellent at metric/imperial unit conversion but hopeless at calculus. In fact, nobody at the agency can now remember how to differentiate a polynomial, let alone evaluate that derivative at a given value of $x$.
So, as any good government agency would, they have decided to outsource the task — to you. And they don't just want the answer: they want you to show every step of the calculation so that they can re-learn the skill.
The first line contains a single integer $n$, the number of polynomials.
Each of the next $n$ lines contains two things separated by a space:
Every polynomial is written in terms of $x$, using single-digit integer coefficients (positive or negative) and non-negative single-digit integer powers of $x$. A polynomial contains no spaces. Coefficients and powers equal to $1$ (and powers equal to $0$) are omitted from the notation, as is any leading "+" sign. The leading term has the highest power, followed by the term with the next-highest power, and so on in descending order.
For each polynomial in the input, output the following lines:
All output follows the same notation as the input: a leading "+" is dropped, later terms are separated by "+" or "-", and coefficients or powers equal to $1$ (and powers equal to $0$) are omitted. In lines 3 and 4 the sign between terms follows each term's coefficient; in line 5 each term has been reduced to a single signed integer, so the signs follow those evaluated values. If the derivative has no terms (the polynomial is constant), print "0" for each of lines 3, 4, 5, and 6.