Tianyi is playing a special game of minesweeper. In this game of minesweeper, the player is given a $$$m\times n$$$ grid with an unknown number of mines planted in random positions. Each square $$$(i,j)$$$ where (0,0) is the top left square is labeled with a number $$$a_{(i,j)}$$$ where $$$a_{(i,j)}$$$ denotes the number of mines that are inside the square or share a vertice with the square (In particular, the label of a square can be at most 9).
Tianyi is told that there are no mines on the edges of the minefield. Help Tianyi locate the positions of the random mines.
The first line contains $$$m,n$$$ ($$$3\le m\le 1000$$$, $$$3\le n\le 1000$$$). The following $$$m$$$ lines contain $$$n$$$ integers that denote the label $$$a_{(i,j)}$$$ where $$$0\le i\le m-1$$$ and $$$0\le j\le n-1$$$.
There are $$$k$$$ lines of output where $$$k$$$ is the number of mines for each given minefield. For each line, output $$$i$$$ $$$j$$$ separated by a space where $$$(i,j)$$$ is the position of a mine. Output the positions of the mine in order from top to bottom and left to right.
If there are no mines in the minefield output 0.
6 6 1 1 2 2 2 1 1 1 3 3 3 1 2 2 4 3 3 1 2 3 4 3 2 1 2 3 3 2 1 1 1 2 2 2 1 1
1 1 1 3 1 4 2 3 3 1 4 1 4 2 4 4