In this problem, we will consider a simple two-dimensional heat transfer model. We start by assuming that we have some rectangular room of dimension which we divide into a grid. Let's call the cell on the row and the column as . Inside the grid, we will randomly scatter a handful of heaters. The initial temperature of the cell is denoted by which is units if there is a heater, units otherwise. At every step in time, there is some heat flow between a cell and its neighbours. The update equation of temperature of cells at time step looks as
In the equation for updating the cell’s temperature, the constant simply represents the rate at which heat flows. The neighbors of cell are the cells which shares a side with cell i.e we consider only four neighbors (top, bottom, left, right).
Given the initial temperature of cells in the grid, Can you tell the temperature of cells after time steps. Since the temperature of cells can be very large output the temperature modulo .
Constraints:
Input Format:
The first line contains four space-separated integers
Next lines contain integers interger in line is . The initial temperature of cell .
Output Format:
Output lines, each containing integer. interger in line denotes the temperature of cell after time steps.
Note: The above figure explains the sample test case.