#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans[3][3];
  memset(ans, 0, sizeof ans);
  for (int i = 0; i < 3; ++i)
    for (int j = 0; j < 3; ++j) {
      int value;
      scanf("%d", &value);
      value %= 2;
      if (value == 1) {
        for (int dx = -1; dx <= 1; ++dx)
          for (int dy = -1; dy <= 1; ++dy) {
            if (abs(dx) == abs(dy) && abs(dx) == 1) continue;
            int x = i + dx;
            int y = j + dy;
            if (x >= 0 && x < 3 && y >= 0 && y < 3) {
              ans[x][y] = 1 - ans[x][y];
            }
          }
      }
    }
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < 3; ++j) {
      printf("%d", 1 - ans[i][j]);
    }
    printf("\n");
  }
  return 0;
}
