#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 1;
const int INF = 2e9;
vector<int> adj[MAX];
int ans[MAX], arr[MAX], vis[MAX];
int main() {
  int n;
  cin >> n;
  queue<int> q;
  fill(ans, ans + n + 1, INF);
  for (int i = 1; i <= n; i++) cin >> arr[i];
  for (int i = 1; i <= n; i++) {
    if (i - arr[i] >= 1) {
      adj[i - arr[i]].push_back(i);
      if (arr[i] % 2 != arr[i - arr[i]] % 2) ans[i] = 1, q.push(i);
    }
    if (i + arr[i] <= n) {
      adj[i + arr[i]].push_back(i);
      if (arr[i] % 2 != arr[i + arr[i]] % 2) ans[i] = 1, q.push(i);
    }
  }
  while (q.size()) {
    int x = q.front();
    q.pop();
    if (vis[x]) continue;
    for (auto i : adj[x]) {
      if (ans[i] > ans[x] + 1) {
        ans[i] = ans[x] + 1;
        q.push(i);
      }
    }
  }
  for (int i = 1; i <= n; i++) cout << (ans[i] == INF ? -1 : ans[i]) << " ";
}
