#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long po(long long x, long long n) {
  long long ans = 1;
  while (n > 0) {
    if (n & 1) ans = (ans * x);
    x = (x * x);
    n /= 2;
  }
  return ans;
}
long long n;
long long a[200000 + 1];
vector<long long> g[200000 + 1];
queue<long long> q;
long long ans[200000 + 1] = {0};
long long vis[200000 + 1];
void bfs() {
  while (!q.empty()) {
    long long u = q.front();
    q.pop();
    for (int i = 0; i < g[u].size(); i++) {
      long long v = g[u][i];
      if (vis[v] == -1) {
        vis[v] = vis[u] + 1;
        q.push(v);
      }
    }
  }
}
void func() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[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);
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] % 2 == 1) {
      vis[i] = 0;
      q.push(i);
    } else
      vis[i] = -1;
  }
  bfs();
  for (int i = 1; i <= n; i++) {
    if (a[i] % 2 == 0) ans[i] = vis[i];
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] % 2 == 0) {
      vis[i] = 0;
      q.push(i);
    } else
      vis[i] = -1;
  }
  bfs();
  for (int i = 1; i <= n; i++) {
    if (a[i] % 2 == 1) ans[i] = vis[i];
  }
  for (int i = 1; i <= n; i++) cout << ans[i] << " ";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) func();
}
