#include <bits/stdc++.h>
using namespace std;
void FST() {}
void solve(long long int a[3][3], long long int i, long long int j) {
  if (a[i][j])
    a[i][j] = 0;
  else
    a[i][j] = 1;
  if (j + 1 < 3)
    if (a[i][j + 1])
      a[i][j + 1] = 0;
    else
      a[i][j + 1] = 1;
  if (i + 1 < 3)
    if (a[i + 1][j])
      a[i + 1][j] = 0;
    else
      a[i + 1][j] = 1;
  if (i - 1 >= 0)
    if (a[i - 1][j])
      a[i - 1][j] = 0;
    else
      a[i - 1][j] = 1;
  if (j - 1 >= 0)
    if (a[i][j - 1])
      a[i][j - 1] = 0;
    else
      a[i][j - 1] = 1;
}
int32_t main() {
  FST();
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int a[3][3];
  for (long long int i = 0; i < 3; i++) {
    for (long long int j = 0; j < 3; j++) {
      a[i][j] = 1;
    }
  }
  for (long long int i = 0; i < 3; i++) {
    for (long long int j = 0; j < 3; j++) {
      long long int x;
      cin >> x;
      if (x) {
        while (x--) solve(a, i, j);
      }
    }
  }
  for (long long int i = 0; i < 3; i++) {
    for (long long int j = 0; j < 3; j++) {
      cout << a[i][j];
    }
    cout << "\n";
  }
  cout << "\n";
  return 0;
}
