#include <bits/stdc++.h>
using namespace std;
const int nmax = 2 * 1e5 + 10;
int n;
int nums[nmax];
int ans[nmax];
vector<int> g[nmax];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", nums + i);
    ans[i] = -1;
  }
  queue<int> q;
  int j;
  for (int i = 1; i <= n; i++) {
    j = i - nums[i];
    if (j >= 1) {
      g[j].push_back(i);
      if ((nums[j] & 1) ^ (nums[i] & 1)) {
        ans[i] = 1;
      }
    }
    j = i + nums[i];
    if (j <= n) {
      g[j].push_back(i);
      if ((nums[j] & 1) ^ (nums[i] & 1)) {
        ans[i] = 1;
      }
    }
    if (ans[i] == 1) {
      q.push(i);
    }
  }
  while (!q.empty()) {
    int i = q.front();
    q.pop();
    for (int x : g[i]) {
      if (ans[x] == -1 && (nums[x] & 1) == (nums[i] & 1)) {
        ans[x] = ans[i] + 1;
        q.push(x);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%d ", ans[i]);
  }
  printf("\n");
  return 0;
}
