#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<vector<int> > l(3, vector<int>(3, 1));
  vector<vector<int> > q(3, vector<int>(3));
  int i, j;
  vector<int> r = {-1, 0, 0, 0, 1};
  vector<int> c = {0, -1, 0, 1, 0};
  int max = -1;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      cin >> q[i][j];
      while (q[i][j]--) {
        for (int k = 0; k < 5; k++) {
          if (!((i + r[k]) < 0 || (i + r[k]) > 2 || (j + c[k]) < 0 ||
                (j + c[k]) > 2)) {
            l[i + r[k]][j + c[k]] = !l[i + r[k]][j + c[k]];
          }
        }
      }
    }
  }
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) cout << l[i][j];
    cout << endl;
  }
}
