#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int n;
  cin >> n;
  int ar[n], ans[n];
  for (int i = 0; i < n; i++) cin >> ar[i];
  memset(ans, -1, sizeof(ans));
  queue<int> q;
  vector<int> v[n];
  for (int i = 0; i < n; i++) {
    int k = i - ar[i];
    if (k >= 0) {
      v[k].push_back(i);
      if (ar[i] % 2 != ar[k] % 2) {
        ans[i] = 1;
        q.push(i);
      }
    }
    k = i + ar[i];
    if (k < n) {
      v[k].push_back(i);
      if (ar[i] % 2 != ar[k] % 2) {
        ans[i] = 1;
        q.push(i);
      }
    }
  }
  while (!q.empty()) {
    int f = q.front();
    q.pop();
    for (int i : v[f]) {
      if (ans[i] == -1 && ar[i] % 2 == ar[f] % 2) {
        ans[i] = ans[f] + 1;
        q.push(i);
      }
    }
  }
  for (int i = 0; i < n; i++) cout << ans[i] << ' ';
}
