#include <bits/stdc++.h>
using namespace std;
int main() {
  int g[3][3];
  int ans[3][3];
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < 3; ++j) {
      cin >> g[i][j];
      ans[i][j] = 1;
    }
  }
  int dx[] = {0, 0, 1, -1};
  int dy[] = {1, -1, 0, 0};
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < 3; ++j) {
      if (g[i][j] % 2 == 1) {
        if (ans[i][j] == 1)
          ans[i][j] = 0;
        else
          ans[i][j] = 1;
      }
      for (int r = 0; r < 4; ++r) {
        int x = dx[r] + i, y = dy[r] + j;
        if (x >= 0 && y >= 0 && x < 3 && y < 3)
          if (g[i][j] % 2 == 1) {
            if (ans[x][y] == 1)
              ans[x][y] = 0;
            else
              ans[x][y] = 1;
          }
      }
    }
  }
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < 3; ++j) {
      cout << ans[i][j];
    }
    cout << endl;
  }
}
