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