#include <bits/stdc++.h>
using namespace std;
bool a[5][5];
int main() {
  for (int i = 1; i < 4; ++i) {
    for (int j = 1, x; j < 4; ++j) {
      a[i][j] ^= 1;
      cin >> x;
      a[i][j] ^= (x & 1);
      a[i + 1][j] ^= (x & 1);
      a[i - 1][j] ^= (x & 1);
      a[i][j + 1] ^= (x & 1);
      a[i][j - 1] ^= (x & 1);
    }
  }
  for (int i = 1; i < 4; ++i) {
    for (int j = 1; j < 4; ++j) {
      cout << a[i][j];
    }
    cout << endl;
  }
}
