#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[6][6], k[10][10], i, j;
  memset(a, 0, sizeof(a));
  for (i = 0; i < 5; ++i) {
    for (j = 0; j < 5; ++j) {
      k[i][j] = 1;
    }
  }
  for (i = 1; i <= 3; ++i) {
    for (j = 1; j <= 3; ++j) {
      scanf("%d", &a[i][j]);
    }
  }
  for (i = 1; i <= 3; ++i) {
    for (j = 1; j <= 3; ++j) {
      if (a[i][j] != 0) {
        k[i][j] += a[i][j];
        k[i][j] %= 2;
        k[i][j + 1] += a[i][j];
        k[i][j + 1] %= 2;
        k[i][j - 1] += a[i][j];
        k[i][j - 1] %= 2;
        k[i + 1][j] += a[i][j];
        k[i + 1][j] %= 2;
        k[i - 1][j] += a[i][j];
        k[i - 1][j] %= 2;
      }
    }
  }
  for (i = 1; i <= 3; ++i) {
    for (j = 1; j <= 3; ++j) {
      printf("%d", k[i][j]);
    }
    printf("\n");
  }
}
