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