#include <bits/stdc++.h>
using namespace std;
void impmat(bool[][4]);
int main() {
  int a[3][3] = {};
  bool b[4][4];
  int i = 0, j = 0;
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++) cin >> a[i][j];
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++) b[i][j] = 1;
  for (i = 0; i < 3; i++)
    for (j = 0; j < 3; j++) {
      if ((a[i][j] % 2) != 0) {
        b[i][j] = !b[i][j];
        b[i - 1][j] = !b[i - 1][j];
        b[i + 1][j] = !b[i + 1][j];
        b[i][j + 1] = !b[i][j + 1];
        b[i][j - 1] = !b[i][j - 1];
      }
    }
  for (i = 0; i < 3; i++) {
    for (j = 0; j < 3; j++) {
      cout << b[i][j];
    }
    cout << '\n';
  }
  return 0;
}
