#include <bits/stdc++.h>
using namespace std;
char getChar(char input) {
  if (input == '0') return '1';
  return '0';
}
int main() {
  int x = 3;
  int y = 3;
  vector<vector<int> > data(3);
  for (int i = 0; i < 3; ++i) data[i].resize(3);
  for (int i = 0; i < 3; ++i)
    for (int j = 0; j < 3; ++j) {
      int tmp;
      cin >> tmp;
      data[i][j] = tmp % 2;
    }
  vector<string> ret;
  for (int i = 0; i < x; ++i) {
    string part = "";
    for (int j = 0; j < y; ++j) {
      part += "1";
    }
    ret.push_back(part);
  }
  for (int i = 0; i < x; ++i) {
    for (int j = 0; j < y; ++j) {
      if (data[i][j] == 1) {
        char newChar = getChar(ret[i][j]);
        ret[i][j] = getChar(ret[i][j]);
        if (i - 1 > -1) ret[i - 1][j] = getChar(ret[i - 1][j]);
        if (j - 1 > -1) ret[i][j - 1] = getChar(ret[i][j - 1]);
        if (j + 1 < y) ret[i][j + 1] = getChar(ret[i][j + 1]);
        if (i + 1 < x) ret[i + 1][j] = getChar(ret[i + 1][j]);
      }
    }
  }
  for (int i = 0; i < x; ++i) cout << ret[i] << endl;
  return 0;
}
