#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cout << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
void solve();
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
}
bool check(int i, int j) {
  if (i < 0 || i > 2 || j < 0 || j > 2) {
    return false;
  }
  return true;
}
int fun(int a[][3], int i, int j) {
  int sum = 0;
  int dx[] = {0, 1, 0, -1, 0};
  int dy[] = {0, 0, 1, 0, -1};
  for (int k = 0; k <= 4; k++) {
    int x = dx[k] + i, y = dy[k] + j;
    if (check(x, y)) {
      sum += a[x][y];
    }
  }
  return sum;
}
void solve() {
  int a[3][3];
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      int x = fun(a, i, j);
      if (x & 1)
        cout << "0";
      else
        cout << "1";
    }
    cout << '\n';
  }
}
