#include <bits/stdc++.h>
using namespace std;
int arr[3][3], a[3][3];
int di[] = {1, -1, 0, 0};
int dj[] = {0, 0, -1, 1};
int main() {
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < 3; ++j) {
      a[i][j] = 1;
    }
  }
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < 3; ++j) {
      cin >> arr[i][j];
      if (arr[i][j] % 2 == 1) {
        a[i][j]++;
        a[i][j] %= 2;
        for (int k = 0; k < 4; ++k) {
          int tx = i + di[k];
          int ty = j + dj[k];
          if (!(tx > 2 || ty > 2 || tx < 0 || ty < 0)) {
            a[tx][ty]++;
            a[tx][ty] %= 2;
          }
        }
      }
    }
  }
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < 3; ++j) cout << a[i][j];
    printf("\n");
  }
  return 0;
}
