You are given a matrix . The matrix rows are numbered from to from top to bottom and the matrix columns are numbered from to from left to right. The cells of the field at the intersection of the row and the column has coordinates .
Every cell is empty or blocked. For every cell , determine if you change the state of cell (empty to blocked or blocked to empty), then is it possible to reach cell from by going only down and right.
Input format
Output format
Print lines where every line contains numbers. Print 0 if it is impossible to reach . Otherwise, print 1.
Constraints
If we blocked cell or , it is obvious that the answer won't exist.
If we blocked cell or , from the left-top corner, we cant achieve cell , since all paths are blocked off.
If we blocked cell or , all possible passes from are blocked off.