Problem Description

Given r c and a grid of 0/1, apply one step of Conway's Game of Life and print new grid.

Input Format

First r c. Next r lines of 0/1.

Output Format

r lines grid.

Sample Test Case

Input:
3 3 000 111 000
Output:
010 010 010

Constraints

r*c

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next