#include <bits/stdc++.h>
void solve() {
  int a[5][5];
  for (int i = 1; i <= 3; ++i)
    for (int j = 1; j <= 3; ++j) a[i][j] = 1;
  for (int i = 1; i <= 3; ++i)
    for (int j = 1; j <= 3; ++j) {
      int x;
      scanf("%d", &x);
      if (x && x % 2 != 0) {
        a[i][j] = a[i][j] ? 0 : 1;
        a[i - 1][j] = a[i - 1][j] ? 0 : 1;
        a[i][j - 1] = a[i][j - 1] ? 0 : 1;
        a[i + 1][j] = a[i + 1][j] ? 0 : 1;
        a[i][j + 1] = a[i][j + 1] ? 0 : 1;
      }
    }
  for (int i = 1; i <= 3; ++i) {
    for (int j = 1; j <= 3; ++j) printf("%d", a[i][j]);
    putchar('\n');
  }
}
int main() {
  int t = 1;
  while (t--) {
    solve();
    putchar('\n');
  }
}
