#include <bits/stdc++.h>
using namespace std;
int a[5][5];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  for (int i = 1; i <= 3; ++i) {
    for (int j = 1; j <= 3; ++j) {
      cin >> a[i][j];
    }
  }
  for (int i = 1; i <= 3; ++i) {
    for (int j = 1; j <= 3; ++j) {
      int val = a[i][j] + a[i][j + 1] + a[i][j - 1] + a[i + 1][j] + a[i - 1][j];
      if (val & 1)
        cout << "0";
      else
        cout << "1";
    }
    cout << "\n";
  }
  return 0;
}
