#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  long long arr[5][5];
  long long temp;
  for (long long i = 0; i < 5; i++)
    for (long long j = 0; j < 5; j++) arr[i][j] = 1;
  for (long long i = 1; i <= 3; i++)
    for (long long j = 1; j <= 3; j++) {
      cin >> temp;
      if (temp % 2 == 1) {
        (arr[i][j] == 1) ? (arr[i][j] = 0) : (arr[i][j] = 1);
        (arr[i - 1][j] == 1) ? (arr[i - 1][j] = 0) : (arr[i - 1][j] = 1);
        (arr[i + 1][j] == 1) ? (arr[i + 1][j] = 0) : (arr[i + 1][j] = 1);
        (arr[i][j - 1] == 1) ? (arr[i][j - 1] = 0) : (arr[i][j - 1] = 1);
        (arr[i][j + 1] == 1) ? (arr[i][j + 1] = 0) : (arr[i][j + 1] = 1);
      }
    }
  for (long long i = 1; i <= 3; i++) {
    for (long long j = 1; j <= 3; j++) {
      cout << arr[i][j];
    }
    cout << endl;
  }
  return 0;
}
