Bitmap
Rectangular bitmap of size is given. Each pixel of the bitmap is either white or black, but at least one is white. The pixel in -th line and -th column is called the pixel . The distance between two pixels and is defined as:
For each pixel find the distance to the nearest white pixel.
Input
The number of test cases is given in the first line, then test cases follow. First line of each test case contains pair of integer numbers . In each of the following lines of the test case exactly one zero-one word of length , the description of one line of the bitmap, is written. On the -th position in the line there is if, and only if the pixel is white.
Output
In the -th line for each test case there should be written integers separated by single spaces, where is the distance from the pixel to the nearest white pixel.