#include <bits/stdc++.h>
using namespace std;
long long M = 1000000000;
long long power(long long x, long long y, long long p = M) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
vector<int> SieveOfEratosthenes(int n) {
  bool prime[n + 1];
  vector<int> Response;
  memset(prime, true, sizeof(prime));
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (int p = 2; p <= n; p++)
    if (prime[p]) Response.push_back(p);
  return Response;
}
long long PowerOfMod(long long a, long long b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  long long temp = PowerOfMod(a, b / 2) % M;
  temp = (temp * temp) % M;
  return b & 1 ? (temp * a) % M : temp;
}
long long cuts(long long OrigionSePoint1, long long TopLeftSeDistance) {
  return (M + OrigionSePoint1 - TopLeftSeDistance) / 2;
}
bool diff(long long n) {
  set<int> numbers;
  int count = 0;
  while (n > 0) {
    numbers.insert(n % 10);
    n /= 10;
    count++;
  }
  return count == numbers.size();
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long arr[3][3];
  long long brr[3][3];
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++) {
      brr[i][j] = 1;
      cin >> arr[i][j];
      arr[i][j] = arr[i][j] % 2 == 0 ? 0 : arr[i][j];
    }
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 3; j++)
      if (arr[i][j] % 2 == 1) {
        brr[i][j] = brr[i][j] == 0 ? 1 : 0;
        for (int k = j - 1; k < j + 2; k++) {
          if (k < 0 || k > 2) continue;
          brr[i][k] = brr[i][k] == 0 ? 1 : 0;
        }
        for (int k = i - 1; k < i + 2; k++) {
          if (k < 0 || k > 2) continue;
          brr[k][j] = brr[k][j] == 0 ? 1 : 0;
        }
      }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 3; j++) cout << brr[i][j];
    cout << endl;
  }
  return 0;
}
