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