{"raw_statement":[{"iden":"problem statement","content":"We have a board with $R$ rows running horizontally and $C$ columns running vertically. Let $(i,j)$ denote the square at the $i$\\-th row from the top and $j$\\-th column from the left.\nYou are given characters $B_{i,j}$ representing the current states of $(i,j)$. `.` represents an empty square; `#` represents a square with a wall; `1`, `2`,$\\dots$, `9` represent a square with a bomb of power $1,2,\\dots,9$, respectively.\nAt the next moment, all bombs will explode **simultaneously**. When a bomb explodes, every square whose Manhattan distance from the square with the bomb is not greater than the power of the bomb will turn into an empty square. Here, the Manhattan distance from $(r_1,c_1)$ to $(r_2,c_2)$ is $|r_1-r_2|+|c_1-c_2|$.\nPrint the board after the explosions."},{"iden":"constraints","content":"*   $1\\leq R,C \\leq 20$\n*   $R$ and $C$ are integers.\n*   Each $B_{i,j}$ is one of `.`, `#`, `1`, `2`, $\\dots$, `9`."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$R$ $C$\n$B_{1,1}B_{1,2}\\dots B_{1,C}$\n$\\vdots$\n$B_{R,1}B_{R,2}\\dots B_{R,C}$"},{"iden":"sample input 1","content":"4 4\n.1.#\n###.\n.#2.\n#.##"},{"iden":"sample output 1","content":"...#\n#...\n....\n#...\n\n![image](https://img.atcoder.jp/abc295/4816cc7b706b4a095bb9a5d07c614790.jpg)\n\n*   The explosion of the bomb at $(1,2)$ will turn the blue squares and purple squares in the above figure into empty squares.\n*   The explosion of the bomb at $(3,3)$ will turn the red squares and purple squares in the above figure into empty squares.\n\nAs seen in this sample, the explosion ranges of bombs may overlap."},{"iden":"sample input 2","content":"2 5\n..#.#\n###.#"},{"iden":"sample output 2","content":"..#.#\n###.#\n\nThere may be no bombs."},{"iden":"sample input 3","content":"2 3\n11#\n###"},{"iden":"sample output 3","content":"...\n..#"},{"iden":"sample input 4","content":"4 6\n#.#3#.\n###.#.\n##.###\n#1..#."},{"iden":"sample output 4","content":"......\n#.....\n#....#\n....#."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}