Graphs

No attempts yetTime limit1sMemory limit256 MB

Problem

Miss Fotheringale teaches her maths class how to plot graphs. For the first exercise her pupils plot the line y=ax+by = ax + b with asterisks for every xx from 0 to 10.

Write a program that prints the correct graphs so she can mark the work quickly.

Input

The first line contains NN, the number of graphs to plot (0<N<300 < N < 30).

Each of the next NN lines describes one graph and holds two non-negative integers AA and BB separated by a space, the values of aa and bb (0A,B<100 \le A, B < 10). AA and BB are never both 0.

Output

For each graph, first print the equation on a line of its own. That line is y = , then the value of AA, then x + , then the value of BB, concatenated in that order.

Below it print the graph, a grid 11 columns wide and A×10+B+1A \times 10 + B + 1 rows tall. The columns correspond to x=0,1,,10x = 0, 1, \dots, 10 from left to right. The bottom row is y=0y = 0, each row above it raises yy by 1, and the top row is y=A×10+By = A \times 10 + B.

Print * in cell (x,y)(x, y) when x=0x = 0 (the yy axis), when y=0y = 0 (the xx axis), or when y=Ax+By = Ax + B. Print a space otherwise. Trailing spaces at the end of a line are ignored.