Table#998

Table

1 second
64 megabytes
Very easy

Given a table with rows and columns, where each cell contains either or . The distance between two cells, (x_1, y_1) and (x_2, y_2), is defined as |x_1 - x_2| + |y_1 - y_2|. Your task is to construct a new table where each cell contains the minimum distance from that cell to any cell containing a in the original table.

It is guaranteed that there is at least one in the table.

Input

The first line contains two natural numbers and (1 \leq N, M \leq 100). The next lines each contain numbers describing the table.

Output

Output lines, each containing numbers, representing the constructed table.

Examples

Example 1

Loading
Loading