#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  vector<int> vc[200005];
  queue<int> q;
  int num[200005];
  int ans[200005] = {};
  int vis[200005] = {};
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &num[i]);
  }
  for (int i = 0; i < n; i++) {
    if (i + num[i] < n) {
      if (num[i + num[i]] % 2 != num[i] % 2) {
        ans[i] = 1;
        vis[i] = 1;
        q.push(i);
      }
      vc[i + num[i]].push_back(i);
    }
    if (i - num[i] >= 0) {
      if (num[i - num[i]] % 2 != num[i] % 2) {
        ans[i] = 1;
        vis[i] = 1;
        q.push(i);
      }
      vc[i - num[i]].push_back(i);
    }
  }
  while (!q.empty()) {
    int tmp = q.front();
    q.pop();
    for (int i = 0; i < (int)vc[tmp].size(); i++) {
      int k = vc[tmp][i];
      if (!vis[k]) {
        vis[k] = 1;
        if (num[tmp] % 2 == num[k] % 2) {
          ans[k] = ans[tmp] + 1;
          q.push(k);
        }
      }
    }
  }
  printf("%d", (ans[0]) ? ans[0] : -1);
  for (int i = 1; i < n; i++) {
    printf(" %d", (ans[i]) ? ans[i] : -1);
  }
  printf("\n");
}
