#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const long long INF = 2e15;
const long long MOD = 1e9 + 7;
const long long MB = 20;
const long long maxN = 5000;
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<vector<long long>> g(n);
  queue<long long> q;
  vector<long long> d(n, -1);
  for (long long i = 0; i < n; i++) {
    if (a[i] % 2 == 0) {
      d[i] = 0;
      q.push(i);
    }
    if (i + a[i] < n) g[i + a[i]].push_back(i);
    if (i - a[i] >= 0) g[i - a[i]].push_back(i);
  }
  while (!q.empty()) {
    long long v = q.front();
    q.pop();
    for (long long u : g[v]) {
      if (d[u] == -1) {
        d[u] = d[v] + 1;
        q.push(u);
      }
    }
  }
  vector<long long> res(n);
  for (long long i = 0; i < n; i++) {
    if (a[i] % 2) res[i] = d[i];
  }
  fill(d.begin(), d.end(), -1);
  for (long long i = 0; i < n; i++) {
    if (a[i] % 2) {
      d[i] = 0;
      q.push(i);
    }
  }
  while (!q.empty()) {
    long long v = q.front();
    q.pop();
    for (long long u : g[v]) {
      if (d[u] == -1) {
        d[u] = d[v] + 1;
        q.push(u);
      }
    }
  }
  for (long long i = 0; i < n; i++) {
    if (a[i] % 2 == 0) res[i] = d[i];
  }
  for (long long i : res) cout << i << " ";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout.precision(12);
  solve();
}
