#include <bits/stdc++.h>
using namespace std;
vector<long long> ans, vec;
vector<vector<long long> > g;
long long n;
void bfs(const vector<long long> &start, const vector<long long> &end) {
  vector<long long> d(n, 1e9);
  queue<long long> q;
  for (long long i : start) {
    q.push(i);
    d[i] = 0;
  }
  while (!q.empty()) {
    long long k = q.front();
    q.pop();
    for (long long i : g[k]) {
      if (d[i] == 1e9) {
        d[i] = d[k] + 1;
        q.push(i);
      }
    }
  }
  for (long long i : end) {
    if (d[i] != 1e9) {
      ans[i] = d[i];
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  vec = vector<long long>(n);
  ans = vector<long long>(n, -1);
  g = vector<vector<long long> >(n);
  vector<long long> odd, even;
  for (long long i = 0; i < n; i++) {
    cin >> vec[i];
    if (vec[i] & 1)
      odd.push_back(i);
    else
      even.push_back(i);
  }
  for (long long i = 0; i < n; i++) {
    long long l = i - vec[i];
    long long r = i + vec[i];
    if (l >= 0) g[l].push_back(i);
    if (r < n) g[r].push_back(i);
  }
  bfs(odd, even);
  bfs(even, odd);
  for (long long i : ans) cout << i << " ";
  cout << '\n';
  return 0;
}
