#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int n, a[N], ans[N], b[N];
vector<int> v[N];
int main() {
  cin >> n;
  memset(ans, -1, sizeof ans);
  queue<int> q;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    if (i + a[i] > n && i - a[i] < 1)
      ans[i] = -1;
    else if (i + a[i] <= n && i - a[i] >= 1) {
      if ((a[i + a[i]] + a[i]) % 2 == 1) ans[i] = 1;
      if ((a[i - a[i]] + a[i]) % 2 == 1) ans[i] = 1;
    } else if (i + a[i] <= n) {
      if ((a[i + a[i]] + a[i]) % 2 == 1) ans[i] = 1;
    } else if (i - a[i] >= 1) {
      if ((a[i - a[i]] + a[i]) % 2 == 1) ans[i] = 1;
    }
    if (ans[i] == -1) {
      if (i + a[i] <= n) v[i + a[i]].push_back(i);
      if (i - a[i] >= 1) v[i - a[i]].push_back(i);
    }
    if (ans[i] == 1) q.push(i);
  }
  while (!q.empty()) {
    int t = q.front();
    q.pop();
    for (auto i : v[t]) {
      if (ans[i] == -1) {
        ans[i] = ans[t] + 1;
        q.push(i);
      }
    }
  }
  for (int i = 1; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
