#include <bits/stdc++.h>
using namespace std;
const int N = 2e+5 + 5;
vector<long long int> adj[N];
bool vis[N], vise[N];
long long int n, de[N], dod[N], a[N], ans[N], cou[N];
long long int Maxi = 1e+9;
queue<long long int> q, qe;
void bfs1() {
  while (!q.empty()) {
    long long int j = q.front();
    q.pop();
    for (auto it : adj[j]) {
      if (!vis[it]) {
        vis[it] = true;
        de[it] = de[j] + 1;
        q.push(it);
      }
    }
  }
  return;
}
void bfs2() {
  while (!qe.empty()) {
    long long int j = qe.front();
    qe.pop();
    for (auto it : adj[j]) {
      if (!vise[it]) {
        vise[it] = true;
        dod[it] = dod[j] + 1;
        qe.push(it);
      }
    }
  }
  return;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] + i <= n) adj[a[i] + i].push_back(i);
    if (i - a[i] >= 1) adj[i - a[i]].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] % 2 == 0) {
      de[i] = 0;
      vis[i] = true;
      q.push(i);
    }
  }
  bfs1();
  for (int i = 1; i <= n; i++) {
    if (a[i] % 2 == 1) {
      dod[i] = 0;
      vise[i] = true;
      qe.push(i);
    }
  }
  bfs2();
  for (int i = 1; i <= n; i++) {
    if (a[i] % 2 == 0)
      ans[i] = dod[i];
    else
      ans[i] = de[i];
    if (ans[i] == 0) ans[i] = -1;
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
}
