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