#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long longinf = 1LL << 60;
const long long mod = 1e9 + 7;
const long double eps = 1e-10;
template <typename T1, typename T2>
inline void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
inline void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
void solve() {
  int n;
  cin >> n;
  vector<int> A(n);
  for (int i = (int)(0); i < (int)(n); i++) cin >> A[i];
  vector<vector<int>> G(n);
  for (int i = (int)(0); i < (int)(n); 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);
  }
  vector<int> ans(n, inf);
  auto bfs = [&](int parity) {
    queue<pair<int, int>> q;
    vector<int> dist(n, inf);
    vector<bool> vis(n);
    for (int i = (int)(0); i < (int)(n); i++) {
      if (A[i] % 2 == parity) {
        q.push({0, i});
        dist[i] = 0;
      }
    }
    while (!q.empty()) {
      auto [d, cur] = q.front();
      q.pop();
      if (vis[cur]) continue;
      if (dist[cur] != d) continue;
      vis[cur] = true;
      for (int ne : G[cur]) {
        if (dist[ne] > dist[cur] + 1) {
          dist[ne] = dist[cur] + 1;
          q.push({dist[ne], ne});
        }
      }
    }
    for (int i = (int)(0); i < (int)(n); i++) {
      if (A[i] % 2 != parity) {
        ans[i] = dist[i];
      }
    }
  };
  bfs(0);
  bfs(1);
  for (int i = (int)(0); i < (int)(n); i++)
    cout << (ans[i] == inf ? -1 : ans[i]) << ' ';
  cout << '\n';
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int T = 1;
  while (T--) solve();
  return 0;
}
