Miss Fotheringale teaches her maths class how to plot graphs. For the first exercise her pupils plot the line y=ax+b with asterisks for every x from 0 to 10.
Write a program that prints the correct graphs so she can mark the work quickly.
The first line contains N, the number of graphs to plot (0<N<30).
Each of the next N lines describes one graph and holds two non-negative integers A and B separated by a space, the values of a and b (0≤A,B<10). A and B are never both 0.
For each graph, first print the equation on a line of its own. That line is y = , then the value of A, then x + , then the value of B, concatenated in that order.
Below it print the graph, a grid 11 columns wide and A×10+B+1 rows tall. The columns correspond to x=0,1,…,10 from left to right. The bottom row is y=0, each row above it raises y by 1, and the top row is y=A×10+B.
Print * in cell (x,y) when x=0 (the y axis), when y=0 (the x axis), or when y=Ax+B. Print a space otherwise. Trailing spaces at the end of a line are ignored.