#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  priority_queue<pair<pair<int, int>, int>> pq;
  vector<vector<int>> dp(2, vector<int>(n, 1 << 30));
  vector<int> edge[n];
  for (int i = 0; i < n; i++) {
    if (i - v[i] >= 0) edge[i - v[i]].push_back(i);
    if (i + v[i] < n) edge[i + v[i]].push_back(i);
  }
  for (int i = 0; i < n; i++) {
    for (int j : edge[i]) {
      if (dp[v[i] % 2][j] > 1) {
        dp[v[i] % 2][j] = 1;
        pq.push({{-1, v[i] % 2}, j});
      }
    }
  }
  while (!pq.empty()) {
    auto p = pq.top();
    pq.pop();
    int cost = -p.first.first, pos = p.second, par = p.first.second;
    if (cost != dp[par][pos]) continue;
    for (int j : edge[pos]) {
      if (dp[par][j] > dp[par][pos] + 1) {
        dp[par][j] = dp[par][pos] + 1;
        pq.push({{-dp[par][j], par}, j});
      }
    }
  }
  for (int i = 0; i < n; i++) {
    cout << (dp[1 - v[i] % 2][i] == 1 << 30 ? -1 : dp[1 - v[i] % 2][i])
         << " \n"[i + 1 == n];
  }
  return 0;
}
