#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n = 3;
  int grid[n][n];
  int ans[n][n];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      cin >> grid[i][j];
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      int s = 0;
      s += (i ? grid[i - 1][j] : 0);
      s += (j ? grid[i][j - 1] : 0);
      s += (j + 1 < n ? grid[i][j + 1] : 0);
      s += (i + 1 < n ? grid[i + 1][j] : 0);
      s += grid[i][j];
      ans[i][j] = !(s & 1);
      cout << ans[i][j];
    }
    cout << endl;
  }
}
int main() {
  solve();
  return 0;
}
