#include <bits/stdc++.h>
using namespace std;
void swap(int ar[3][3], int a, int b) {
  int i, j;
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      if ((i == (a - 1) || i == a || i == (a + 1)) && j == b) {
        if (ar[i][j] == 1)
          ar[i][j] = 0;
        else
          ar[i][j] = 1;
      } else if ((j == (b - 1) || j == b || j == (b + 1)) && i == a) {
        if (ar[i][j] == 1)
          ar[i][j] = 0;
        else
          ar[i][j] = 1;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long k;
  int ar[3][3];
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) ar[i][j] = 1;
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> k;
      if (k % 2 != 0) swap(ar, i, j);
    }
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) cout << ar[i][j];
    cout << endl;
  }
}
