#include <bits/stdc++.h>
using namespace std;
void toogle(vector<vector<int> >& v, int i, int j) {
  if (v[i][j] == 1) {
    v[i][j] = 0;
  } else if (v[i][j] == 0) {
    v[i][j] = 1;
  }
}
int main() {
  vector<vector<int> > v(3, vector<int>(3, 1));
  int i, j, e;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      cin >> e;
      if (e % 2 == 0) {
        continue;
      } else {
        toogle(v, i, j);
        if (i - 1 >= 0) toogle(v, i - 1, j);
        if (j - 1 >= 0) toogle(v, i, j - 1);
        if (i + 1 < 3) toogle(v, i + 1, j);
        if (j + 1 < 3) toogle(v, i, j + 1);
      }
    }
  }
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      cout << v[i][j];
    }
    cout << endl;
  }
}
