#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int a[5][5], b;
  for (int i = 0; i < 5; i++) {
    for (int j = 0; j < 5; j++) {
      a[i][j] = 1;
    }
  }
  for (int i = 1; i < 4; i++) {
    for (int j = 1; j < 4; j++) {
      cin >> b;
      while (b) {
        a[i][j] = a[i][j] ? 0 : 1;
        a[i + 1][j] = a[i + 1][j] ? 0 : 1;
        a[i - 1][j] = a[i - 1][j] ? 0 : 1;
        a[i][j + 1] = a[i][j + 1] ? 0 : 1;
        a[i][j - 1] = a[i][j - 1] ? 0 : 1;
        b--;
      }
    }
  }
  for (int i = 1; i < 4; i++) {
    for (int j = 1; j < 4; j++) {
      cout << a[i][j];
    }
    cout << endl;
  }
  return 0;
}
