#include <bits/stdc++.h>
using namespace std;
int n, a[200043], ans[200043];
vector<int> rg[200043];
int main() {
  memset(ans, -1, sizeof(ans));
  cin >> n;
  queue<int> q;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n; ++i) {
    if (i - a[i] >= 0) {
      rg[i - a[i]].push_back(i);
      if (a[i - a[i]] % 2 != a[i] % 2) {
        ans[i] = 1;
      }
    }
    if (i + a[i] < n) {
      rg[i + a[i]].push_back(i);
      if (a[i + a[i]] % 2 != a[i] % 2) {
        ans[i] = 1;
      }
    }
    if (ans[i] == 1) {
      q.push(i);
    }
  }
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int to : rg[v]) {
      if (ans[to] == -1 && a[to] % 2 == a[v] % 2) {
        ans[to] = ans[v] + 1;
        q.push(to);
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    cout << ans[i] << " ";
  }
  return 0;
}
