#include <bits/stdc++.h>
using namespace std;
void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }
template <typename T, typename V>
void __print(const pair<T, V> &x) {
  cerr << '{';
  __print(x.first);
  cerr << ',';
  __print(x.second);
  cerr << '}';
}
template <typename T>
void __print(const T &x) {
  int f = 0;
  cerr << '{';
  for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
  cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
  __print(t);
  if (sizeof...(v)) cerr << ", ";
  _print(v...);
}
int C[3][3];
bool L[3][3];
void solve() {
  for (int i = 0; i < 3; ++i)
    for (int j = 0; j < 3; ++j) cin >> C[i][j];
  memset(L, true, sizeof(bool) * 9);
  const auto &light_up = [&](int x, int y) {
    if (x < 0 || x >= 3 || y < 0 || y >= 3) return;
    L[x][y] = !L[x][y];
    if (x + 1 < 3) L[x + 1][y] = !L[x + 1][y];
    if (x - 1 >= 0) L[x - 1][y] = !L[x - 1][y];
    if (y + 1 < 3) L[x][y + 1] = !L[x][y + 1];
    if (y - 1 >= 0) L[x][y - 1] = !L[x][y - 1];
  };
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < 3; ++j) {
      while (C[i][j] > 0) {
        light_up(i, j);
        --C[i][j];
      }
    }
  }
  for (int i = 0; i < 3; ++i) {
    for (int j = 0; j < 3; ++j) {
      cout << static_cast<int>(L[i][j]);
    }
    cout << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
  return 0;
}
