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