#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  vector<vector<int>> from(N);
  vector<int> ans(N, -1);
  queue<int> que;
  for (int i = 0; i < N; i++)
    for (int to : {i - A[i], i + A[i]})
      if (0 <= to && to < N) {
        from[to].push_back(i);
        if (A[i] % 2 != A[to] % 2) {
          ans[i] = 1;
          que.push(i);
        }
      }
  while (que.size()) {
    int i = que.front();
    que.pop();
    for (int j : from[i])
      if (ans[j] == -1) {
        ans[j] = ans[i] + 1;
        que.push(j);
      }
  }
  for (int i = 0; i < N; i++) cout << ans[i] << " \n"[i == N - 1];
  return 0;
}
