#include <bits/stdc++.h>
using namespace std;
int testnum;
vector<long long> nums;
int cnt;
void preprocess() {}
int a[3][3];
int getnumber(int i, int j) {
  int r = a[i][j];
  if (i - 1 >= 0) r += a[i - 1][j];
  if (j - 1 >= 0) r += a[i][j - 1];
  if (i + 1 < 3) r += a[i + 1][j];
  if (j + 1 < 3) r += a[i][j + 1];
  return r;
}
void solve() {
  int i, j;
  for (i = 0; i < 3; ++i)
    for (j = 0; j < 3; ++j) cin >> a[i][j];
  for (i = 0; i < 3; ++i) {
    for (j = 0; j < 3; ++j) {
      int x = getnumber(i, j);
      if (x % 2 == 0)
        cout << "1";
      else
        cout << "0";
    }
    cout << "\n";
  }
}
bool input() { return true; }
int main() {
  preprocess();
  int T = 1;
  for (testnum = 1; testnum <= T; testnum++) {
    if (!input()) break;
    solve();
  }
  return 0;
}
