#include <bits/stdc++.h>
using namespace std;
int a[5][5];
int main() {
  for (int row = 1; row <= 3; row++)
    for (int col = 1; col <= 3; col++) cin >> a[row][col];
  for (int row = 1; row <= 3; row++) {
    for (int col = 1; col <= 3; col++)
      cout << 1 - ((a[row][col] + a[row + 1][col] + a[row - 1][col] +
                    a[row][col - 1] + a[row][col + 1])) %
                      2;
    cout << endl;
  }
}
