#include <bits/stdc++.h>
using namespace std;
int sum(int[][3], int, int);
bool valid(int);
int main() {
  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) cout << !(sum(A, i, j) % 2);
    cout << '\n';
  }
  return 0;
}
bool valid(int x) { return (x > -1 && x < 3); }
int sum(int A[][3], int i, int j) {
  int s = 0, k;
  for (k = -1; k < 2; ++k) {
    int I = i + k;
    if (valid(I)) s += A[I][j];
    if (k) {
      int J = j + k;
      if (valid(J)) s += A[i][J];
    }
  }
  return s;
}
