#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, arr[3][3], temp[3][3];
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      arr[i][j] = 1;
    }
  }
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      cin >> temp[i][j];
      if (temp[i][j] % 2 == 1) {
        arr[i][j] = !arr[i][j];
        if (j + 1 <= 2) arr[i][j + 1] = !arr[i][j + 1];
        if (j - 1 >= 0) arr[i][j - 1] = !arr[i][j - 1];
        if (i + 1 <= 2) arr[i + 1][j] = !arr[i + 1][j];
        if (i - 1 >= 0) arr[i - 1][j] = !arr[i - 1][j];
      }
    }
  }
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      cout << arr[i][j];
    }
    cout << endl;
  }
  return 0;
}
