In the event of technical difficulties with Szkopuł, please contact us via email at szkopul@fri.edu.pl.

If you are familiar with IRC chat, the support team is also reachable on PIRC network (`irc.pirc.pl`

) in `#szkopul`

channel. If you are not, just use email.

Please do not ask us things like "how to solve task XYZ?".

Please remember that the support team has to sleep sometimes or go to work in real life.

There is given a rectangular bitmap of size . 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:

Write a program which:

- reads the description of the bitmap from standard input,
- for each pixel, computes the distance to the nearest white pixel,
- writes the results to the standard output.

In the first line of the standard input there is a pair of integer numbers , separated by a single space, , . In each of the following lines of the input exactly one zero-one word of length , the description of one line of the bitmap, is written. On the -th position in the line , , , is `1` if, and only if the pixel is white.

In the -th line of the standard output, , there should be written integers separated by single spaces, where is the distance from the pixel to the nearest white pixel.

For the input data:

3 4 0001 0011 0110

the correct result is:

3 2 1 0 2 1 0 0 1 0 0 1

*Task author: Marcin Sawicki.*