#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int> > r(n);
  queue<int> q;
  vector<int> val(n, -1);
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    int b = i + a[i];
    int c = i - a[i];
    if (b < n) r[b].push_back(i);
    if (c >= 0) r[c].push_back(i);
  }
  for (int i = 0; i < n; i++) {
    for (int next : r[i]) {
      if ((a[next] + a[i]) % 2 == 1 && val[next] == -1) {
        val[next] = 1;
        q.push(next);
      }
    }
  }
  while (!q.empty()) {
    int node = q.front();
    q.pop();
    for (int next : r[node]) {
      if (val[next] == -1) {
        val[next] = val[node] + 1;
        q.push(next);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (i) cout << " ";
    cout << val[i];
  }
  cout << endl;
  return 0;
}
