#include <bits/stdc++.h>
using namespace std;
vector<int>::iterator IntIter;
vector<long long>::iterator LLIter;
int main(int argc, char *argv[]) {
  int i, j;
  int a[3][3];
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++) cin >> a[i][j];
  int b[3][3] = {1};
  b[0][0] = (a[0][0] + a[0][1] + a[1][0]) % 2;
  b[0][1] = (a[0][0] + a[0][1] + a[0][2] + a[1][1]) % 2;
  b[0][2] = (a[0][1] + a[0][2] + a[1][2]) % 2;
  b[1][0] = (a[1][0] + a[0][0] + a[1][1] + a[2][0]) % 2;
  b[1][1] = (a[1][0] + a[1][1] + a[1][2] + a[0][1] + a[2][1]) % 2;
  b[1][2] = (a[1][1] + a[1][2] + a[0][2] + a[2][2]) % 2;
  b[2][0] = (a[2][0] + a[1][0] + a[2][1]) % 2;
  b[2][1] = (a[1][1] + a[2][0] + a[2][1] + a[2][2]) % 2;
  b[2][2] = (a[1][2] + a[2][1] + a[2][2]) % 2;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      if (b[i][j]) {
        cout << "0";
      } else {
        cout << "1";
      }
    }
    cout << endl;
  }
  return 0;
}
