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