#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[9], i, b[9];
  for (i = 0; i < 9; i++) cin >> a[i];
  b[0] = a[1] + a[3] + a[0];
  b[1] = a[0] + a[2] + a[4] + a[1];
  b[2] = a[1] + a[5] + a[2];
  b[3] = a[0] + a[4] + a[6] + a[3];
  b[4] = a[1] + a[3] + a[5] + a[7] + a[4];
  b[5] = a[2] + a[4] + a[8] + a[5];
  b[6] = a[3] + a[7] + a[6];
  b[7] = a[6] + a[4] + a[8] + a[7];
  b[8] = a[5] + a[7] + a[8];
  for (i = 0; i < 9; i++) {
    if (b[i] % 2 == 0)
      b[i] = 1;
    else
      b[i] = 0;
  }
  cout << b[0] << b[1] << b[2] << endl;
  cout << b[3] << b[4] << b[5] << endl;
  cout << b[6] << b[7] << b[8] << endl;
}
