#include <bits/stdc++.h>
using namespace std;
int main() {
  bool arr[3][3];
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++) arr[i][j] = 1;
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++) {
      int m;
      cin >> m;
      if (m % 2 == 0)
        continue;
      else {
        if (i - 1 >= 0) arr[i - 1][j] = !arr[i - 1][j];
        if (i + 1 < 3) arr[i + 1][j] = !arr[i + 1][j];
        if (j + 1 < 3) arr[i][j + 1] = !arr[i][j + 1];
        if (j - 1 >= 0) arr[i][j - 1] = !arr[i][j - 1];
        arr[i][j] = !arr[i][j];
      }
    }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cout << arr[i][j];
    }
    cout << endl;
  }
}
