Given a grid with n*m grid points and (n-1)*(m-1) blocks. There may be a number of 0 or 1 in some block, represents the number of lines surround this block is odd or even.(0 for even and 1 for odd) When there is no number, there is no limit to the number of lines surround this block.
You have to draw lines between the grid points to form several cycles (a cycle in the grid is a non-empty trail in which the only repeated grid points are the first and last grid points). Two cycles can share grid points but can not share lines.
Please find the number of different solution modulo 998244353. When a line exists in one solution and does not exist in the other solution, the two solutions are considered different.