#include <bits/stdc++.h>
int main() {
  int a[3][3], i, j;
  while (~scanf("%d", &a[0][0])) {
    int b[3][3] = {0};
    scanf("%d%d", &a[0][1], &a[0][2]);
    for (i = 1; i < 3; i++)
      for (j = 0; j < 3; j++) scanf("%d", &a[i][j]);
    for (i = 0; i < 3; i++)
      for (j = 0; j < 3; j++) {
        if (a[i][j]) {
          b[i][j] += a[i][j];
          if (i > 0) b[i - 1][j] += a[i][j];
          if (i < 2) b[i + 1][j] += a[i][j];
          if (j > 0) b[i][j - 1] += a[i][j];
          if (j < 2) b[i][j + 1] += a[i][j];
        }
      }
    for (i = 0; i < 3; i++) {
      for (j = 0; j < 3; j++) {
        if (b[i][j] % 2 == 0)
          printf("1");
        else
          printf("0");
      }
      printf("\n");
    }
  }
  return 0;
}
