#include <bits/stdc++.h>
using namespace std;
bool range(int i, int j) {
  if (i < 3 && i >= 0 && j < 3 && j >= 0) return true;
  return false;
}
int main() {
  vector<vector<bool>> lights(3, vector<bool>(3, 1));
  vector<vector<bool>> buttons(3, vector<bool>(3, 0));
  int t;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> t;
      int v{t % 2};
      if (v == 1) buttons[i][j] = 1;
    }
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      if (buttons[i][j] == 1) {
        lights[i][j] = !lights[i][j];
        if (range(i + 1, j)) lights[i + 1][j] = !lights[i + 1][j];
        if (range(i - 1, j)) lights[i - 1][j] = !lights[i - 1][j];
        if (range(i, j + 1)) lights[i][j + 1] = !lights[i][j + 1];
        if (range(i, j - 1)) lights[i][j - 1] = !lights[i][j - 1];
      }
    }
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cout << lights[i][j];
    }
    cout << "\n";
  }
  return 0;
}
