#include <bits/stdc++.h>
using namespace std;
vector<int> a;
vector<vector<int>> sameEdge;
vector<vector<int>> diffEdge;
void BFS(int n) {
  vector<int> ans(n, -1);
  queue<int> Q;
  for (int i = 0; i < n; i++) {
    for (int next : diffEdge[i]) {
      ans[next] = 1;
      Q.push(next);
    }
  }
  while (!Q.empty()) {
    int cur = Q.front();
    Q.pop();
    for (int next : sameEdge[cur]) {
      if (ans[next] == -1) {
        ans[next] = ans[cur] + 1;
        Q.push(next);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] << " ";
  }
}
int main() {
  int n;
  cin >> n;
  a = vector<int>(n);
  sameEdge = vector<vector<int>>(n);
  diffEdge = vector<vector<int>>(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    int next = i + a[i];
    if (next >= 0 && next < n) {
      if ((a[i] & 1) == (a[next] & 1)) {
        sameEdge[next].push_back(i);
      } else
        diffEdge[next].push_back(i);
    }
    next = i - a[i];
    if (next >= 0 && next < n) {
      if ((a[i] & 1) == (a[next] & 1)) {
        sameEdge[next].push_back(i);
      } else
        diffEdge[next].push_back(i);
    }
  }
  BFS(n);
}
