#include <bits/stdc++.h>
int ara[5][5] = {0};
int main() {
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= 3; j++) {
      scanf(" %d", &ara[i][j]);
    }
  }
  for (int i = 1; i <= 3; i++) {
    for (int j = 1; j <= 3; j++) {
      printf("%d", (ara[i][j] + ara[i][j + 1] + ara[i - 1][j] + ara[i + 1][j] +
                    ara[i][j - 1] + 1) %
                       2);
    }
    printf("\n");
  }
}
