#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 100;
int n;
vector<int> v[N];
int a[N], b[N], c[N];
void bfs(int x) {
  c[x] = 1;
  queue<int> q;
  q.push(x);
  while (!q.empty()) {
    int s = q.front();
    q.pop();
    for (int w : v[s]) {
      if (!c[w]) {
        c[w] = c[s] + 1;
        q.push(w);
      }
    }
  }
}
int main() {
  cin >> n;
  for (int i = 2; i <= n + 1; i++) {
    cin >> a[i];
    v[a[i] & 1].push_back(i);
    if (i - a[i] > 1) v[i - a[i]].push_back(i);
    if (i + a[i] <= n + 1) v[i + a[i]].push_back(i);
  }
  bfs(0);
  for (int i = 2; i <= n + 1; i++)
    if ((a[i] & 1) == 1) b[i] = c[i] - 2;
  memset(c, 0, sizeof(c));
  bfs(1);
  for (int i = 2; i <= n + 1; i++) {
    if ((a[i] & 1) == 0) b[i] = c[i] - 2;
    cout << max(b[i], -1) << " ";
  }
  return 0;
}
