#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned int turn, array[4][4] = {0};
  for (unsigned int i = 1; i <= 3; i++)
    for (unsigned int j = 1; j <= 3; j++) cin >> array[i][j];
  for (unsigned int i = 1; i <= 3; i++) {
    for (unsigned int j = 1; j <= 3; j++)
      cout << ((array[i][j] + array[i][j - 1] + array[i][j + 1] +
                array[i - 1][j] + array[i + 1][j] + 1) %
               2);
    cout << endl;
  }
  return 0;
}
