#include <bits/stdc++.h>
using namespace std;
int main() {
  int m[10][10] = {0};
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= 3; j++) {
      cin >> m[i][j];
    }
  }
  int s = 0;
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= 3; j++) {
      s = m[i][j];
      s += m[i + 1][j];
      s += m[i - 1][j];
      s += m[i][j + 1];
      s += m[i][j - 1];
      s % 2 ? cout << 0 : cout << 1;
    }
    cout << "\n";
  }
}
