Consider a rectangular grid of size $$$N \times M$$$. Each cell is colored black or white.
For each cell, you have to execute exactly one of the three operations given below.
Two cells are neighbors if they share a side.
Your goal is make all cells white. Find a way to achieve it, or determine that it is impossible.
The first line contains two integers $$$N$$$ and $$$M$$$, the dimensions of the grid ($$$1 \le N, M \le 2000$$$).
Each of the next $$$N$$$ lines describes one row of the grid. Each of these lines contains $$$M$$$ characters denoting the colors of cells in the row. Each character is either "B" for black or "W" for white.
Print "-1" on the first line if it is impossible to make all cells white.
Otherwise, print "1" on the first line, followed by $$$N$$$ more lines. Each of these lines must contain $$$M$$$ characters which describe the operations you chose for the respective row of the grid. Each of the characters must be either "1", "2", or "3", corresponding to the three operations in the statement. If there are several solutions, print any one of them.
2 3 WBW BWB
1 111 121
1 1 B
1 3
| Name |
|---|


