#include <bits/stdc++.h>
using namespace std;
struct G {
  int n, m;
  int Next[1000003];
  int head[200003];
  int ver[1000003];
  int val[1000003];
  int tot;
  void add(int x, int y, long long w) {
    ver[++tot] = y, Next[tot] = head[x], head[x] = tot, val[tot] = w;
  }
  void clear() {
    tot = 0;
    memset(head, 0, sizeof(head));
  }
} g;
struct Dij {
  long long d[200003];
  int vis[200003];
  priority_queue<pair<int, int>, vector<pair<int, int>>,
                 greater<pair<int, int>>>
      q;
  int s;
  void dij(int s, const G &g) {
    for (register int i = (1); i < g.n + 1; i++) d[i] = 0x3f3f3f3f;
    memset(vis, 0, sizeof(vis));
    d[s] = 0;
    q.push(pair<int, int>{0, s});
    while (!q.empty()) {
      pair<int, int> p = q.top();
      q.pop();
      int x = p.second;
      if (vis[x]) continue;
      vis[x] = 1;
      for (int i = g.head[x]; i; i = g.Next[i]) {
        int y = g.ver[i];
        int w = g.val[i];
        if (d[y] > d[x] + w) {
          d[y] = d[x] + w;
          q.push(pair<int, int>{d[y], y});
        }
      }
    }
  }
} d1;
int vis[200003];
int a[200003];
int n;
void build(int i) {
  vis[i] = 1;
  if (i + a[i] <= n) {
    if ((a[i] ^ a[i + a[i]]) & 0x1) g.add(0, i, 1);
    g.add(i + a[i], i, 1);
    if (!vis[i + a[i]]) build(i + a[i]);
  }
  if (i - a[i] >= 1) {
    if ((a[i] ^ a[i - a[i]]) & 0x1) g.add(0, i, 1);
    g.add(i - a[i], i, 1);
    if (!vis[i - a[i]]) build(i - a[i]);
  }
}
int main() {
  scanf("%d", &n);
  g.n = n;
  for (register int i = (1); i < n + 1; i++) scanf("%d", &a[i]);
  for (register int i = (1); i < n + 1; i++)
    if (!vis[i]) build(i);
  d1.dij(0, g);
  for (register int i = (1); i < n + 1; i++)
    if (d1.d[i] == 0x3f3f3f3f)
      printf("-1 ");
    else
      printf("%d ", d1.d[i]);
  return 0;
}
