#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int a[200005];
int dp[200005][2];
int n;
vector<int> vv[maxn];
int ans[200005];
queue<int> qq;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= n; i++) {
    if (i + a[i] <= n) {
      if ((a[i + a[i]] % 2) ^ 1 == a[i] % 2) {
        if (ans[i] == 0) {
          qq.push(i);
          ans[i] = 1;
        }
      } else {
        vv[i + a[i]].push_back(i);
      }
    }
    if (i - a[i] >= 1) {
      if (a[i - a[i]] % 2 == (a[i] % 2) ^ 1) {
        if (ans[i] == 0) {
          qq.push(i);
          ans[i] = 1;
        }
      } else
        vv[i - a[i]].push_back(i);
    }
  }
  while (!qq.empty()) {
    int x = qq.front();
    qq.pop();
    for (int i = 0; i < vv[x].size(); i++) {
      int v = vv[x][i];
      if (ans[v] == 0) {
        ans[v] = ans[x] + 1;
        qq.push(v);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (ans[i] == 0) ans[i] = -1;
    printf("%d ", ans[i]);
  }
  printf("\n");
}
