#include <bits/stdc++.h>
using namespace std;
void show(vector<long long> v) {
  for (auto it = v.begin(); it != v.end(); ++it) {
    cout << *it << " ";
  }
  cout << "\n";
}
void solve() {
  long long arr[3][3], arr2[3][3];
  for (long long i = 0; i < 3; i++)
    for (long long j = 0; j < 3; j++) arr2[i][j] = 0;
  for (long long i = 0; i < 3; i++) {
    for (long long j = 0; j < 3; j++) {
      cin >> arr[i][j];
      if (i - 1 >= 0) arr2[i - 1][j] += arr[i][j];
      if (i + 1 < 3) arr2[i + 1][j] += arr[i][j];
      if (j - 1 >= 0) arr2[i][j - 1] += arr[i][j];
      if (j + 1 < 3) arr2[i][j + 1] += arr[i][j];
    }
  }
  for (long long i = 0; i < 3; i++) {
    for (long long j = 0; j < 3; j++) {
      cout << (arr[i][j] + arr2[i][j] + 1) % 2;
    }
    cout << "\n";
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
