#include <bits/stdc++.h>
using namespace std;
int main() {
  int input[3][3], output[3][3];
  for (int i = 0; i < 3; i++) {
    for (int y = 0; y < 3; y++) {
      cin >> input[i][y];
      output[i][y] = 0;
    }
  }
  for (int i = 0; i < 3; i++) {
    for (int y = 0; y < 3; y++) {
      switch (i) {
        case 0:
          output[1][y] += input[i][y];
          break;
        case 1:
          output[i + 1][y] += input[i][y];
          output[i - 1][y] += input[i][y];
          break;
        case 2:
          output[i - 1][y] += input[i][y];
          break;
      }
      switch (y) {
        case 0:
          output[i][y + 1] += input[i][y];
          break;
        case 1:
          output[i][y + 1] += input[i][y];
          output[i][y - 1] += input[i][y];
          break;
        case 2:
          output[i][y - 1] += input[i][y];
          break;
      }
    }
  }
  for (int i = 0; i < 3; i++) {
    for (int y = 0; y < 3; y++) {
      output[i][y] += input[i][y];
    }
  }
  for (int i = 0; i < 3; i++) {
    for (int y = 0; y < 3; y++) {
      cout << (output[i][y] + 1) % 2;
    }
    cout << endl;
  }
  return 0;
}
