#include <bits/stdc++.h>
using namespace std;
bool cond[100][100];
long mapp[100][100], x;
int main() {
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= 3; j++) {
      cond[i][j] = true;
    }
  }
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= 3; j++) {
      cin >> x;
      if (x % 2 == 1) {
        mapp[i][j] = 1;
      } else {
        mapp[i][j] = 0;
      }
    }
  }
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= 3; j++) {
      if (mapp[i][j] == 1) {
        cond[i][j] = !cond[i][j];
        if (i - 1 >= 1) {
          cond[i - 1][j] = !cond[i - 1][j];
        }
        if (i + 1 <= 3) {
          cond[i + 1][j] = !cond[i + 1][j];
        }
        if (j - 1 >= 1) {
          cond[i][j - 1] = !cond[i][j - 1];
        }
        if (j + 1 <= 3) {
          cond[i][j + 1] = !cond[i][j + 1];
        }
      }
    }
  }
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= 3; j++) {
      cout << cond[i][j];
    }
    cout << endl;
  }
}
