Hard choice
If you have some dilemma, then choose simply one (c) Alan
Alan relocates to the city where buildings. All buildings can be represented as a grid with rows and columns. Some buildings in the city are special. Each day Alan will choose some building and he will get confused if there are two special buildings with equal distances to the chosen one. Distance calculated as the sum of absolute difference of rows and columns, i.e. distance from to is .
For each building determine if Alan can live there without getting confused.
Input
The first line contains one integer — the number of rows and columns. The next lines contain integers that equal to if building at the cell is special, and otherwise.
Output
Output lines, each with integers. Number equals to if Alan can live at the corresponding building without being confused, otherwise .