#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int arr[3][3];
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) cin >> arr[i][j];
  }
  bool chk[3][3];
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) chk[i][j] = 1;
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (arr[i][j] % 2 == 0)
        continue;
      else {
        if (chk[i][j] == 1)
          chk[i][j] = 0;
        else
          chk[i][j] = 1;
        if (j + 1 <= 2) {
          if (chk[i][j + 1] == 1)
            chk[i][j + 1] = 0;
          else
            chk[i][j + 1] = 1;
        }
        if (j - 1 >= 0) {
          if (chk[i][j - 1] == 1)
            chk[i][j - 1] = 0;
          else
            chk[i][j - 1] = 1;
        }
        if (i + 1 <= 2) {
          if (chk[i + 1][j] == 1)
            chk[i + 1][j] = 0;
          else
            chk[i + 1][j] = 1;
        }
        if (i - 1 >= 0) {
          if (chk[i - 1][j] == 1)
            chk[i - 1][j] = 0;
          else
            chk[i - 1][j] = 1;
        }
      }
    }
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cout << chk[i][j];
    }
    cout << '\n';
  }
  return 0;
}
