Mr. Nežmah received a puzzle for his birthday. The puzzle can be represented as a grid with $$$n$$$ rows and $$$m$$$ columns. Each cell can be one of 12 types, labeled with numbers from $$$0$$$ to $$$9$$$ and with $$$A$$$ and $$$B$$$. Some of the cells are static, some can be rotated by specific degrees, and some function as switches. A detailed explanation of all the types follows this graphic:
Graphic of all types of cells All cell types except $$$0$$$ have a positive number of arms. The goal of the puzzle is to pair up all the arms inside the grid. The cells can be transformed according to their type.
Nežmah wants to solve the puzzle, so he needs your help!
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 2 \cdot 10^4$$$), the number of test cases.
The first line of each test case contains integers $$$n$$$ and $$$m$$$ ($$$1 \leq n, m \leq 10^3)$$$.
The following $$$n$$$ lines contain strings of length $$$m$$$ describing the $$$n$$$ rows of the grid. The $$$j$$$-th character in the $$$i$$$-th string denotes the type of the cell in the $$$i$$$-th row and $$$j$$$-th column.
It is guaranteed that the sum of $$$n \cdot m$$$ over all test cases does not exceed $$$10^6$$$.
For each test case, output $$$2n - 1$$$ lines. Each line should contain a string of length $$$2m - 1$$$. If the cell in the $$$i$$$-th row and $$$j$$$-th column is of non-zero type, the character in the $$$(2i - 1)$$$-th string on the $$$(2j - 1)$$$-th position should be 'o'. Each 'o' should have a possible construction of arms going out of it (according to the type of the appropriate cell). Vertical arms are denoted with '|' and horizontal ones with '-'. All other characters should be '.'.
A solution is guaranteed to exist, and if there are multiple solutions, you can output any of them.
34 42A702A5887A221A52 268357 6065258622143B9BBB05B2B207B3A86432A12282A15
o-o-o..|.|....o-o-o.o......|o.o-o-o|...|..o-o-o-oo.o|.|o.o..o-o.o-o.o......|...|o.o-o.o.o.o|.|.|.|.|..o-o-o.o-o..|.|.|.|.|..o.o-o.o-o....|...|....o-o.o-o-o.o..|.......|o.o.o-o-o-o|...|.|....o-o.o-o-o-o
| Name |
|---|


