you & ndash; Biologist studying the behavior of cell colonies. You have a square mesh, which is a cell habitat. Each cage in this grid can be alive or dead. At each step of time, the condition of the cell changes depending on the state of its neighbors.
rn
rn rn -
rn - a living cage with two or three living neighbors remains alive.
rn - a living cage with more than three living neighbors dies (from overpopulation).
rn - The dead cell comes to life with three living neighbors.
rn rn
rn
with neighborhoods Cells are eight cells surrounding it (from below, left, right, right and diagonally).
rn
write a program that takes a program that takes The initial state of the grid and the number of steps of time that must be simulated. The program must derive the condition of the grid after the specified number of steps.
Input format
The whole number of n & nbsp; & ndash; The size of the grid (number of lines and columns).
rn
in the following n & nbsp; the rows are introduced the initial state of the grid. Each line contains & nbsp; n & nbsp; symbols where & nbsp; . & nbsp; denotes a dead cage, and & nbsp; * & nbsp; denotes lively cell.
rn
in the last line the integer stps & ndash; The number of simulation steps
Output format
get & nbsp; n & nbsp; lines, which are a state of mesh After & nbsp; stps & nbsp; steps. Each line must contain & nbsp; n & nbsp; symbols (.
Hint
There will be no clue here, decide for yourself!