#include <bits/stdc++.h>
using namespace std;
int w[10][10], v[10][10], i, j;
int main() {
  for (i = 0; i <= 4; i++) {
    v[i][4] = 0;
    v[i][0] = 0;
    v[4][i] = 0;
    v[0][i] = 0;
  }
  for (i = 1; i <= 3; i++)
    for (j = 1; j <= 3; j++) scanf("%d", &v[i][j]);
  for (i = 1; i <= 3; i++)
    for (j = 1; j <= 3; j++)
      w[i][j] = v[i][j] + v[i + 1][j] + v[i - 1][j] + v[i][j + 1] + v[i][j - 1];
  for (i = 1; i <= 3; i++) {
    for (j = 1; j <= 3; j++) printf("%d", (w[i][j] + 1) % 2);
    printf("\n");
  }
  return 0;
}
