Lenny is playing a game on a 3 × 3 grid of lights. In the beginning of the game all lights are switched on. Pressing any of the lights will toggle it and all side-adjacent lights. The goal of the game is to switch all the lights off. We consider the toggling as follows: if the light was switched on then it will be switched off, if it was switched off then it will be switched on.

Lenny has spent some time playing with the grid and by now he has pressed each light a certain number of times. Given the number of times each light is pressed, you have to print the current state of each light.
The input consists of three rows. Each row contains three integers each between 0 to 100 inclusive. The *j*-th number in the *i*-th row is the number of times the *j*-th light of the *i*-th row of the grid is pressed.
"""
செயல் பேசும் ஆழம் இங்கே சொற்கள் பேசுமா?

Focus, Determination and Sheer-Will

The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep.
"""

import os, sys, math, cmath, time, collections
from collections import deque, Counter, OrderedDict, defaultdict
from heapq import nsmallest, nlargest, heapify, heappop, heappush, heapreplace
from math import ceil, floor, log, log2, sqrt, gcd, factorial, pow, pi
from bisect import bisect_left, bisect_right
from functools import reduce


# SOME GENERAL HELPER
def input_as_array():
    return list(map(int, input().split()))


def debug():
    if os.path.exists("data.in"):
        print("*" * 10)


def debug3():
    if os.path.exists("data.in"):
        print("-" * 10)


def debug2(value):
    if os.path.exists("data.in"):
        print(value)


start_time = time.time()

R, C = 3, 3

def neighbours(r, c, R, C):
    for rows, cols in ((r - 1, c), (r, c - 1), (r + 1, c), (r, c + 1)):
        if 0 <= rows < R and 0 <= cols < C:
            yield rows, cols

def solve(A):
    """
    Initially everything is switched ON
    Odd number off, even number on
    Press 1 time - off
    press 2 times - on

    It will toggle it, and all it's adjacent lights....

    4 time press - neighbour OFF (o)
    4 times press 0 neighbour ON (1)

    Initially ON
    OFF ON OFF ON
        Nei - off initially
             ON OFF ON OFF
        Nei - ON

    Nei OFF

    ON OFF ON

    """
    debug2(A)
    G = [[1, 1, 1],[1, 1, 1], [1, 1, 1]]
    debug2(G)
    # print("Going to solve")
    debug3()

    for i in range(3):
        for j in range(3):
            if A[i][j] > 0 and A[i][j] & 1:
                G[i][j] = 0
                for nr, nc in neighbours(i, j, 3, 3):
                    if G[nr][nc] == 1:
                        G[nr][nc] = 0
                    elif G[nr][nc] == 0:
                        G[nr][nc] = 1

            elif A[i][j] > 0 and A[i][j] % 2 == 0:
                G[i][j] = 1
                for nr, nc in neighbours(i, j, 3, 3):
                    if G[nr][nc] == 1:
                        G[nr][nc] = 0
                    elif G[nr][nc] == 0:
                        G[nr][nc] = 1

            # for i in range(3):
            #     print(*G[i])
            # debug3()

    for i in range(3):
        print(''.join(str(c) for c in G[i]))

def main():
    A = []
    for i in range(3):
        r = input_as_array()
        A.append(r)
    solve(A)
    debug()


if __name__ == "__main__":
    if os.path.exists("data.in"):
        sys.stdin = open("data.in", "r")
        sys.stdout = open("data.out", "w")

    testcases = 1
    for i in range(testcases):
        main()

    # If it's local - Print this O/P
    if os.path.exists("data.in"):
        print(f"Time Elapsed: {time.time() - start_time} seconds")
        sys.stdout.close()