#include<bits/stdc++.h>
using namespace std;
int a[3][3] = {
{1,1,1} ,
{1,1,1},
{1,1,1}
};
int dx[] = {0, 1, 0, -1, 0 };
int dy[] = {0, 0, 1, 0 , -1 };
void chan(int x,int y){
for(int i=0;i<5;i++){
int xx = x+dx[i];
int yy = y+dy[i];
if(xx>=0 && yy>=0 && xx<3 && yy<3){
}
else continue;
if(a[xx][yy]==1) a[xx][yy]=0;
else a[xx][yy]=1;
}
}
int main(){
int b;
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cin>>b;
if(b%2==1){
chan(i,j);
}
}
}
for(int i=0;i<3;i++){
for(int j=0;j<3;j++){
cout<<a[i][j];
}
cout<<"\n";
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBhWzNdWzNdID0gewogezEsMSwxfSAsCiB7MSwxLDF9LAogezEsMSwxfQp9OwoKaW50IGR4W10gPSB7MCwgMSwgMCwgLTEsIDAgfTsKaW50IGR5W10gPSB7MCwgMCwgMSwgMCAsIC0xIH07Cgp2b2lkIGNoYW4oaW50IHgsaW50IHkpewoKICAgIGZvcihpbnQgaT0wO2k8NTtpKyspewogICAgICAgIGludCB4eCA9IHgrZHhbaV07CiAgICAgICAgaW50IHl5ID0geStkeVtpXTsKICAgICAgICBpZih4eD49MCAmJiB5eT49MCAmJiB4eDwzICYmIHl5PDMpewoKICAgICAgICB9CiAgICAgICAgZWxzZSBjb250aW51ZTsKCiAgICAgICAgaWYoYVt4eF1beXldPT0xKSBhW3h4XVt5eV09MDsKICAgICAgICBlbHNlIGFbeHhdW3l5XT0xOwogICAgfQoKfQoKaW50IG1haW4oKXsKCiAgICBpbnQgYjsKICAgIGZvcihpbnQgaT0wO2k8MztpKyspewogICAgICAgIGZvcihpbnQgaj0wO2o8MztqKyspewogICAgICAgICAgICBjaW4+PmI7CiAgICAgICAgICAgIGlmKGIlMj09MSl7CiAgICAgICAgICAgICAgICBjaGFuKGksaik7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICB9CgogICAgZm9yKGludCBpPTA7aTwzO2krKyl7CiAgICAgICAgZm9yKGludCBqPTA7ajwzO2orKyl7CiAgICAgICAgICAgIGNvdXQ8PGFbaV1bal07CiAgICAgICAgfQogICAgICAgIGNvdXQ8PCJcbiI7CiAgICB9CgoKICAgIHJldHVybiAwOwoKfQo=