#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  vector<int> dis(n, 1000000005);
  vector<int> adj[n];
  queue<int> q;
  for (int i = 0; i < n; i++) {
    int l = i + arr[i];
    int r = i - arr[i];
    if (l < n) {
      if ((arr[i] + arr[l]) & 1) {
        dis[i] = 1;
        q.push(i);
      } else {
        adj[l].push_back(i);
      }
    }
    if (r >= 0) {
      if ((arr[i] + arr[r]) & 1) {
        dis[i] = 1;
        q.push(i);
      } else {
        adj[r].push_back(i);
      }
    }
  }
  while (!q.empty()) {
    int s = q.front();
    q.pop();
    for (int x : adj[s]) {
      if (dis[x] != 1000000005) continue;
      dis[x] = dis[s] + 1;
      q.push(x);
    }
  }
  for (int i : dis) {
    if (i == 1000000005)
      cout << "-1 ";
    else
      cout << i << " ";
  }
  return 0;
}
