#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  bool grid[3][3] = {
      {true, true, true}, {true, true, true}, {true, true, true}};
  const int SIZE = 3;
  int input[SIZE][SIZE];
  for (int i = 0; i < SIZE; i++) {
    for (int j = 0; j < SIZE; j++) {
      cin >> input[i][j];
      if (input[i][j] % 2 != 0)
        input[i][j] = 1;
      else
        input[i][j] = 0;
    }
  }
  for (int i = 0; i < SIZE; i++) {
    for (int j = 0; j < SIZE; j++) {
      if (input[i][j] == 1) {
        grid[i][j] = !grid[i][j];
        if ((j + 1) < SIZE) {
          grid[i][j + 1] = !grid[i][j + 1];
        }
        if ((i + 1) < SIZE) {
          grid[i + 1][j] = !grid[i + 1][j];
        }
        if ((i - 1) >= 0) {
          grid[i - 1][j] = !grid[i - 1][j];
        }
        if ((j - 1) >= 0) {
          grid[i][j - 1] = !grid[i][j - 1];
        }
      }
    }
  }
  for (int i = 0; i < SIZE; i++) {
    for (int j = 0; j < SIZE; j++) cout << grid[i][j];
    cout << endl;
  }
  return 0;
}
