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