#include <bits/stdc++.h>
using namespace std;
int main() {
  bool map[5][5];
  int num[5][5];
  memset(map, 1, sizeof(map));
  for (int i = 1; i <= 3; i++)
    for (int j = 1; j <= 3; j++) {
      cin >> num[i][j];
      if (num[i][j] % 2 == 1) {
        map[i][j] = !map[i][j];
        map[i - 1][j] = !map[i - 1][j];
        map[i + 1][j] = !map[i + 1][j];
        map[i][j - 1] = !map[i][j - 1];
        map[i][j + 1] = !map[i][j + 1];
      }
    }
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= 3; j++) cout << map[i][j];
    cout << endl;
  }
  return 0;
}
