#include <bits/stdc++.h>
using namespace std;
void solve() {
  vector<vector<int> > v(3, vector<int>(3));
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++) cin >> v[i][j];
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      int t = v[i][j];
      if (i != 0) t += v[i - 1][j];
      if (i != 2) t += v[i + 1][j];
      if (j != 0) t += v[i][j - 1];
      if (j != 2) t += v[i][j + 1];
      if (t & 1)
        cout << "0";
      else
        cout << "1";
    }
    cout << endl;
  }
}
int main() {
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
