#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j;
  int a[5][5], b[5][5];
  for (i = 0; i < 5; i++)
    for (j = 0; j < 5; j++) {
      a[i][j] = 0;
      b[i][j] = 0;
    }
  for (i = 1; i < 4; i++)
    for (j = 1; j < 4; j++) cin >> a[i][j];
  for (i = 1; i < 4; i++)
    for (j = 1; j < 4; j++)
      b[i][j] = a[i][j] + a[i][j + 1] + a[i + 1][j] + a[i - 1][j] + a[i][j - 1];
  for (i = 1; i < 4; i++) {
    for (j = 1; j < 4; j++) {
      if (b[i][j] % 2)
        cout << "0";
      else
        cout << "1";
    }
    cout << endl;
  }
  return 0;
}
