#include <bits/stdc++.h>
using namespace std;
int main() {
  int input[5][5];
  int output[5][5];
  int r = 1;
  while (r <= 3) {
    int c = 1;
    while (c <= 3) {
      cin >> input[r][c];
      c++;
    }
    r++;
  }
  int r1 = 0;
  while (r1 <= 4) {
    int c1 = 0;
    while (c1 <= 4) {
      output[r1][c1] = 1;
      c1++;
    }
    r1++;
  }
  int r2 = 1;
  while (r2 <= 3) {
    int c2 = 1;
    while (c2 <= 3) {
      if (input[r2][c2] % 2 != 0) {
        int k1 = -1;
        while (k1 <= 1) {
          if (output[r2 + k1][c2] == 0) {
            output[r2 + k1][c2] = 1;
          } else {
            output[r2 + k1][c2] = 0;
          }
          k1++;
        }
        int constant = output[r2][c2];
        int k2 = -1;
        while (k2 <= 1) {
          if (output[r2][c2 + k2] == 0) {
            output[r2][c2 + k2] = 1;
          } else {
            output[r2][c2 + k2] = 0;
          }
          k2++;
        }
        output[r2][c2] = constant;
      }
      c2++;
    }
    r2++;
  }
  int r3 = 1;
  while (r3 <= 3) {
    int c3 = 1;
    while (c3 <= 3) {
      cout << output[r3][c3];
      c3++;
    }
    cout << endl;
    r3++;
  }
}
