#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const double PI = 2 * acos(0.0);
bool vailed(int i, int j) { return i >= 0 && j >= 0 && i < 3 && j < 3; }
int main() {
  string s[3] = {"111", "111", "111"};
  int u;
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> u;
      if (u == 0) continue;
      s[i][j] = u % 2 == 0       ? s[i][j] == '1' ? '1' : '0'
                : s[i][j] == '1' ? '0'
                                 : '1';
      if (vailed(i + 1, j))
        s[i + 1][j] = u % 2 == 0           ? s[i + 1][j] == '1' ? '1' : '0'
                      : s[i + 1][j] == '1' ? '0'
                                           : '1';
      ;
      if (vailed(i, j + 1))
        s[i][j + 1] = u % 2 == 0           ? s[i][j + 1] == '1' ? '1' : '0'
                      : s[i][j + 1] == '1' ? '0'
                                           : '1';
      ;
      if (vailed(i - 1, j))
        s[i - 1][j] = u % 2 == 0           ? s[i - 1][j] == '1' ? '1' : '0'
                      : s[i - 1][j] == '1' ? '0'
                                           : '1';
      ;
      if (vailed(i, j - 1))
        s[i][j - 1] = u % 2 == 0           ? s[i][j - 1] == '1' ? '1' : '0'
                      : s[i][j - 1] == '1' ? '0'
                                           : '1';
      ;
    }
  }
  for (long long i = 0; i < (3); i++) cout << s[i] << endl;
}
