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