#include <bits/stdc++.h>
using namespace std;
int n, a[200010];
vector<int> adj[200010];
queue<int> q;
int ans[200010];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (1 <= i - a[i]) adj[i - a[i]].emplace_back(i);
    if (i + a[i] <= n) adj[i + a[i]].emplace_back(i);
    ans[i] = -1;
  }
  for (int i = 1; i <= n; i++) {
    for (auto k : adj[i]) {
      if ((a[k] ^ a[i]) & 1) q.push(k), ans[k] = 1;
    }
  }
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (auto v : adj[u]) {
      if (ans[v] == -1) ans[v] = ans[u] + 1, q.push(v);
    }
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
