#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5;
long long a[N];
vector<long long> g[N];
void solve() {
  long long n;
  cin >> n;
  vector<long long> d(n, -1);
  queue<long long> q;
  for (long long i = 0; i < n; ++i) cin >> a[i];
  for (long long i = 0; i < n; ++i) {
    if (i - a[i] > -1) {
      g[i - a[i]].push_back(i);
      if (a[i - a[i]] % 2 != a[i] % 2) d[i] = 1;
    }
    if (i + a[i] < n) {
      g[i + a[i]].push_back(i);
      if (a[i + a[i]] % 2 != a[i] % 2) d[i] = 1;
    }
    if (d[i] == 1) q.push(i);
  }
  while (q.size()) {
    long long x = q.front();
    q.pop();
    for (long long to : g[x])
      if (d[to] == -1 && a[x] % 2 == a[to] % 2) {
        d[to] = d[x] + 1;
        q.push(to);
      }
  }
  for (long long i : d) cout << i << " ";
}
int32_t main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) solve();
}
