#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define ff first
#define ar array
#define ss second
#define ll long long int
#define mem(x) memset(x,0,sizeof(x))
#define setbits(x)  __builtin_popcount(x)
#define ull unsigned long long int
#define all(c) (c).begin(),(c).end()
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define db double
#define endl "\n"
#define  fbo(x) find_by_order(x)
#define  ook(x) order_of_key(x)

using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os1;
typedef tree<int, null_type, greater<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os2;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair<ll,ll > iil;
typedef pair<ll,int> li;
typedef pair<int,int> ii;
inline void fast()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
const ll pi=31;
const ll MOD[2] = {1187278649, 1149736019};//for double hashing
const ll mod=(ll)(1e9)+7;
ll pmod(ll x,ll n){
  ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;
}
ll pMod(ll x,ll n,ll mod)
{ ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;

}

//think recursively also;
const int mxn=2e5;
int n;
ll a[mxn+1];
ll dp[mxn+1];
void dfs(int u,set<int>s,int id,int add)
{
  if(u<=0 || u>n)
    return;
  if(s.find(u)!=s.end() || dp[u]==-1)
  {
     dp[id]=-1;
     return;
  }
  s.insert(u);
  dp[id]+=a[u];
  u+=add*a[u];
  dfs(u,s,id,-1*add);
  s.erase(u);
}
void solve()
{
cin>>n;
for(int i=2;i<=n;i++)
{
  cin>>a[i];
}

 for(int i=1;i<n;i++)
 {
   if(dp[i]==0)
   {set<int>s;
    dp[i]+=i;
    dfs(1+i,s,i,-1);
   }
 }
 for(int i=1;i<n;i++)
 {
  cout<<dp[i]<<endl;
 }

}
int main()
{
  fast();
   // int t;
   // cin>>t;
   // for(int casee=1;casee<=t;casee++)
  {//cout<<"Case #"<<casee<<": ";
    solve();
  }

}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define ff first
#define ar array
#define ss second
#define ll long long int
#define mem(x) memset(x,0,sizeof(x))
#define setbits(x)  __builtin_popcount(x)
#define ull unsigned long long int
#define all(c) (c).begin(),(c).end()
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define db double
#define endl "\n"
#define  fbo(x) find_by_order(x)
#define  ook(x) order_of_key(x)

using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os1;
typedef tree<int, null_type, greater<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os2;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair<ll,ll > iil;
typedef pair<ll,int> li;
typedef pair<int,int> ii;
inline void fast()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
const ll pi=31;
const ll MOD[2] = {1187278649, 1149736019};//for double hashing
const ll mod=(ll)(1e9)+7;
ll pmod(ll x,ll n){
  ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;
}
ll pMod(ll x,ll n,ll mod)
{ ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;

}

//think recursively also;
const int mxn=2e5;
ll n;
ll a[mxn+1];
ll dp[mxn+1][2];
set<ll>s;
ll dfs(ll u,ll id,ll add)
{
  if(u<=0 || u>n)
    return 0;
  int ty=add;
  if(ty==-1)
    ty=0;
   if(s.find(u)!=s.end())
   {
    return INT_MIN;
   }
  if(dp[u][ty]!=-1)
    return dp[u][ty];
  //dp[u][ty]=INT_MIN;
  s.insert(u);
  ll ans=0;
  ans+=a[u];
  ll pv=u;
  u+=add*a[u];
  ll c=dfs(u,id,-1LL*add);
  s.erase(u);
  if(c==INT_MIN)
    ans=INT_MIN;
  else
    ans+=c;
  return dp[pv][ty]=ans;

}
void solve()
{
cin>>n;
for(int i=2;i<=n;i++)
{
  cin>>a[i];
}
memset(dp,-1,sizeof(dp));
 for(int i=1;i<n;i++)
 {
  s.clear();
   dp[1][1]=-1;
   a[1]=i;
   ll ans=dfs(1,i,1);
   if(ans==INT_MIN)
   {
    cout<<-1<<endl;
    continue;
   }
   //debug2(ans,i);

    cout<<ans<<endl;

 }
 // for(int i=1;i<n;i++)
 // {
 //  cout<<dp[i]<<endl;
 // }

}
int main()
{
  fast();
   // int t;
   // cin>>t;
   // for(int casee=1;casee<=t;casee++)
  {//cout<<"Case #"<<casee<<": ";
    solve();
  }

}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define ff first
#define ar array
#define ss second
#define ll long long int
#define mem(x) memset(x,0,sizeof(x))
#define setbits(x)  __builtin_popcount(x)
#define ull unsigned long long int
#define all(c) (c).begin(),(c).end()
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define db double
#define endl "\n"
#define  fbo(x) find_by_order(x)
#define  ook(x) order_of_key(x)

using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os1;
typedef tree<int, null_type, greater<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os2;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair<ll,ll > iil;
typedef pair<ll,int> li;
typedef pair<int,int> ii;
inline void fast()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
const ll pi=31;
const ll MOD[2] = {1187278649, 1149736019};//for double hashing
const ll mod=(ll)(1e9)+7;
ll pmod(ll x,ll n){
  ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;
}
ll pMod(ll x,ll n,ll mod)
{ ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;

}

//think recursively also;
const int mxn=2e5;
ll n;
ll a[mxn+1];
ll dp[mxn+1][2];
set<ll>s;
ll dfs(ll u,ll id,ll add)
{
  if(u<=0 || u>n)
    return 0;
  int ty=add;
  if(ty==-1)
    ty=0;
  if(dp[u][ty]!=0)
    return dp[u][ty];
  dp[u][ty]=INT_MIN;
  ll ans=0;
  ans+=a[u];
  ll pv=u;
  u+=add*a[u];
  ll c=dfs(u,id,-1LL*add);
  if(c==INT_MIN)
    ans=INT_MIN;
  else
    ans+=c;
  return dp[pv][ty]=ans;

}
void solve()
{
cin>>n;
for(int i=2;i<=n;i++)
{
  cin>>a[i];
}
//memset(dp,-1,sizeof(dp));
 for(int i=1;i<n;i++)
 {

   dp[1][1]=0;
   a[1]=i;
   ll ans=dfs(1,i,1);

   if(ans==INT_MIN)
   {
    cout<<-1<<endl;
    continue;
   }
   //debug2(ans,i);

    cout<<ans<<endl;

 }
 // for(int i=1;i<n;i++)
 // {
 //  cout<<dp[i]<<endl;
 // }

}
int main()
{
  fast();
   // int t;
   // cin>>t;
   // for(int casee=1;casee<=t;casee++)
  {//cout<<"Case #"<<casee<<": ";
    solve();
  }

}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define ff first
#define ar array
#define ss second
#define ll long long int
#define mem(x) memset(x,0,sizeof(x))
#define setbits(x)  __builtin_popcount(x)
#define ull unsigned long long int
#define all(c) (c).begin(),(c).end()
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define db double
#define endl "\n"
#define  fbo(x) find_by_order(x)
#define  ook(x) order_of_key(x)

using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os1;
typedef tree<int, null_type, greater<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os2;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair<ll,ll > iil;
typedef pair<ll,int> li;
typedef pair<int,int> ii;
inline void fast()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
const ll pi=31;
const ll MOD[2] = {1187278649, 1149736019};//for double hashing
const ll mod=(ll)(1e9)+7;
ll pmod(ll x,ll n){
  ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;
}
ll pMod(ll x,ll n,ll mod)
{ ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;

}

//think recursively also;
const int mxn=2e5;
int n;
int a[mxn+1];
ll dp[mxn+1];
set<int>s;
void dfs(int u,int id,int add)
{
  if(u<=0 || u>n)
    return;
  if(s.find(u)!=s.end() || dp[u]==-1)
  {
     dp[id]=-1;
     return;
  }
  s.insert(u);
  dp[id]+=a[u];
  u+=add*a[u];
  dfs(u,id,-1*add);

}
void solve()
{
cin>>n;
for(int i=2;i<=n;i++)
{
  cin>>a[i];
}
 for(int i=1;i<n;i++)
 {
   if(dp[i]==0)
   {s.clear();
    dp[i]+=i;
    dfs(1+i,i,-1);
   }
 }
 for(int i=1;i<n;i++)
 {
  cout<<dp[i]<<endl;
 }

}
int main()
{
  fast();
   // int t;
   // cin>>t;
   // for(int casee=1;casee<=t;casee++)
  {//cout<<"Case #"<<casee<<": ";
    solve();
  }

}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define ff first
#define ar array
#define ss second
#define ll long long int
#define mem(x) memset(x,0,sizeof(x))
#define setbits(x)  __builtin_popcount(x)
#define ull unsigned long long int
#define all(c) (c).begin(),(c).end()
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define db double
#define endl "\n"
#define  fbo(x) find_by_order(x)
#define  ook(x) order_of_key(x)

using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os1;
typedef tree<int, null_type, greater<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os2;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair<ll,ll > iil;
typedef pair<ll,int> li;
typedef pair<int,int> ii;
inline void fast()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
const ll pi=31;
const ll MOD[2] = {1187278649, 1149736019};//for double hashing
const ll mod=(ll)(1e9)+7;
ll pmod(ll x,ll n){
  ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;
}
ll pMod(ll x,ll n,ll mod)
{ ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;

}

//think recursively also;
const int mxn=2e5;
int n;
int a[mxn+1];
ll dp[mxn+1];
set<int>s;
void dfs(int u,int id,int add)
{
  if(u<=0 || u>n)
    return;
  if(s.find(u)!=s.end() || dp[u]==-1)
  {
     dp[id]=-1;
     return;
  }
  s.insert(u);
  dp[id]+=a[u];
  u+=add*a[u];
  dfs(u,id,-1*add);
  s.erase(u);
}
void solve()
{
cin>>n;
for(int i=2;i<=n;i++)
{
  cin>>a[i];
}
 for(int i=1;i<n;i++)
 {
   if(dp[i]==0)
   {s.clear();
    dp[i]+=i;
    dfs(1+i,i,-1);
   }
 }
 for(int i=1;i<n;i++)
 {
  cout<<dp[i]<<endl;
 }

}
int main()
{
  fast();
   // int t;
   // cin>>t;
   // for(int casee=1;casee<=t;casee++)
  {//cout<<"Case #"<<casee<<": ";
    solve();
  }

}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define ff first
#define ar array
#define ss second
#define ll long long int
#define mem(x) memset(x,0,sizeof(x))
#define setbits(x)  __builtin_popcount(x)
#define ull unsigned long long int
#define all(c) (c).begin(),(c).end()
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define db double
#define endl "\n"
#define  fbo(x) find_by_order(x)
#define  ook(x) order_of_key(x)

using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os1;
typedef tree<int, null_type, greater<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os2;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair<ll,ll > iil;
typedef pair<ll,int> li;
typedef pair<int,int> ii;
inline void fast()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
const ll pi=31;
const ll MOD[2] = {1187278649, 1149736019};//for double hashing
const ll mod=(ll)(1e9)+7;
ll pmod(ll x,ll n){
  ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;
}
ll pMod(ll x,ll n,ll mod)
{ ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;

}

//think recursively also;
const int mxn=2e5;
ll n;
ll a[mxn+1];
ll dp[mxn+1][2];
set<iil>s;
ll dfs(ll u,ll id,ll add)
{
  if(u<=0 || u>n)
    return 0;
  int ty=add;
  if(ty==-1)
    ty=0;
   if(s.find(mp(u,ty))!=s.end())
   {
    return INT_MIN;
   }
  if(dp[u][ty]!=-1)
    return dp[u][ty];
  //dp[u][ty]=INT_MIN;
  s.insert(mp(u,ty));
  ll ans=0;
  ans+=a[u];
  ll pv=u;
  u+=add*a[u];
  ll c=dfs(u,id,-1LL*add);
    if(c==INT_MIN)
    ans=INT_MIN;
  else
    ans+=c;
  return dp[pv][ty]=ans;

}
void solve()
{
cin>>n;
for(int i=2;i<=n;i++)
{
  cin>>a[i];
}
memset(dp,-1,sizeof(dp));
 for(int i=1;i<n;i++)
 {
  s.clear();
   dp[1][1]=-1;
   a[1]=i;
   ll ans=dfs(1,i,1);
   if(ans==INT_MIN)
   {
    cout<<-1<<endl;
    continue;
   }
   //debug2(ans,i);

    cout<<ans<<endl;

 }
 // for(int i=1;i<n;i++)
 // {
 //  cout<<dp[i]<<endl;
 // }

}
int main()
{
  fast();
   // int t;
   // cin>>t;
   // for(int casee=1;casee<=t;casee++)
  {//cout<<"Case #"<<casee<<": ";
    solve();
  }

}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define ff first
#define ar array
#define ss second
#define ll long long int
#define mem(x) memset(x,0,sizeof(x))
#define setbits(x)  __builtin_popcount(x)
#define ull unsigned long long int
#define all(c) (c).begin(),(c).end()
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define db double
#define endl "\n"
#define  fbo(x) find_by_order(x)
#define  ook(x) order_of_key(x)

using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os1;
typedef tree<int, null_type, greater<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os2;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair<ll,ll > iil;
typedef pair<ll,int> li;
typedef pair<int,int> ii;
inline void fast()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
const ll pi=31;
const ll MOD[2] = {1187278649, 1149736019};//for double hashing
const ll mod=(ll)(1e9)+7;
ll pmod(ll x,ll n){
  ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;
}
ll pMod(ll x,ll n,ll mod)
{ ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;

}

//think recursively also;
const int mxn=2e5;
int n;
int a[mxn+1];
ll dp[mxn+1];
set<int>s;
ll dfs(int u,int id,int add)
{
  if(u<=0 || u>n)
    return 0;
  if(s.find(u)!=s.end() || dp[u]==INT_MIN)
  {
    return INT_MIN;
  }
  if(dp[u]!=-1)
    return dp[u];
  s.insert(u);
  ll ans=0;
  ans+=a[u];
  ll pv=u;
  u+=add*a[u];
  ans+=dfs(u,id,-1*add);
  dp[pv]=ans;
  return ans;

}
void solve()
{
cin>>n;
for(int i=2;i<=n;i++)
{
  cin>>a[i];
}
memset(dp,-1,sizeof(dp));
 for(int i=1;i<n;i++)
 {

   s.clear();
   ll ans=dfs(1+i,i,-1);
   if(ans<0)
   {
    cout<<-1<<endl;
    continue;
   }
   ans+=i;
    cout<<ans<<endl;

 }
 // for(int i=1;i<n;i++)
 // {
 //  cout<<dp[i]<<endl;
 // }

}
int main()
{
  fast();
   // int t;
   // cin>>t;
   // for(int casee=1;casee<=t;casee++)
  {//cout<<"Case #"<<casee<<": ";
    solve();
  }

}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define ff first
#define ar array
#define ss second
#define ll long long int
#define mem(x) memset(x,0,sizeof(x))
#define setbits(x)  __builtin_popcount(x)
#define ull unsigned long long int
#define all(c) (c).begin(),(c).end()
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define db double
#define endl "\n"
#define  fbo(x) find_by_order(x)
#define  ook(x) order_of_key(x)

using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os1;
typedef tree<int, null_type, greater<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os2;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair<ll,ll > iil;
typedef pair<ll,int> li;
typedef pair<int,int> ii;
inline void fast()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
const ll pi=31;
const ll MOD[2] = {1187278649, 1149736019};//for double hashing
const ll mod=(ll)(1e9)+7;
ll pmod(ll x,ll n){
  ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;
}
ll pMod(ll x,ll n,ll mod)
{ ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;

}

//think recursively also;
const int mxn=2e5;
int n;
int a[mxn+1];
ll dp[mxn+1][2];
set<int>s;
ll dfs(int u,int id,int add)
{
  if(u<=0 || u>n)
    return 0;
  int ty=add;
  if(ty==-1)
    ty=0;
  if(s.find(u)!=s.end() || dp[u][ty]<-1)
  {
    return INT_MIN;
  }
  if(dp[u][ty]!=-1)
    return dp[u][ty];
  s.insert(u);
  ll ans=0;
  ans+=a[u];
  ll pv=u;
  u+=add*a[u];
  ans+=dfs(u,id,-1*add);
  dp[pv][ty]=ans;
  return ans;

}
void solve()
{
cin>>n;
for(int i=2;i<=n;i++)
{
  cin>>a[i];
}
memset(dp,-1,sizeof(dp));
 for(int i=1;i<n;i++)
 {

   s.clear();
   ll ans=dfs(1+i,i,-1);
   if(ans<0)
   {
    cout<<-1<<endl;
    continue;
   }
   ans+=i;
    cout<<ans<<endl;

 }
 // for(int i=1;i<n;i++)
 // {
 //  cout<<dp[i]<<endl;
 // }

}
int main()
{
  fast();
   // int t;
   // cin>>t;
   // for(int casee=1;casee<=t;casee++)
  {//cout<<"Case #"<<casee<<": ";
    solve();
  }

}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define ff first
#define ar array
#define ss second
#define ll long long int
#define mem(x) memset(x,0,sizeof(x))
#define setbits(x)  __builtin_popcount(x)
#define ull unsigned long long int
#define all(c) (c).begin(),(c).end()
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define db double
#define endl "\n"
#define  fbo(x) find_by_order(x)
#define  ook(x) order_of_key(x)

using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os1;
typedef tree<int, null_type, greater<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os2;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair<ll,ll > iil;
typedef pair<ll,int> li;
typedef pair<int,int> ii;
inline void fast()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
const ll pi=31;
const ll MOD[2] = {1187278649, 1149736019};//for double hashing
const ll mod=(ll)(1e9)+7;
ll pmod(ll x,ll n){
  ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;
}
ll pMod(ll x,ll n,ll mod)
{ ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;

}

//think recursively also;
const int mxn=2e5;
int n;
int a[mxn+1];
ll dp[mxn+1][2];
set<int>s;
ll dfs(int u,int id,int add)
{
  if(u<=0 || u>n)
    return 0;
  int ty=add;
  if(ty==-1)
    ty=0;
  if(s.find(u)!=s.end() || dp[u][ty]==INT_MIN)
  {
    return INT_MIN;
  }
  if(dp[u][ty]!=-1)
    return dp[u][ty];
  s.insert(u);
  ll ans=0;
  ans+=a[u];
  ll pv=u;
  u+=add*a[u];
  ll c=dfs(u,id,-1*add);
  if(c==INT_MIN)
    ans=INT_MIN;
  else
    ans+=c;
  dp[pv][ty]=ans;
  return ans;

}
void solve()
{
cin>>n;
for(int i=2;i<=n;i++)
{
  cin>>a[i];
}
memset(dp,-1,sizeof(dp));
 for(int i=1;i<n;i++)
 {

   s.clear();
   ll ans=dfs(1+i,i,-1);

   if(ans==INT_MIN)
   {
    cout<<-1<<endl;
    continue;
   }
   //debug2(ans,i);
   ans+=i;
    cout<<ans<<endl;

 }
 // for(int i=1;i<n;i++)
 // {
 //  cout<<dp[i]<<endl;
 // }

}
int main()
{
  fast();
   // int t;
   // cin>>t;
   // for(int casee=1;casee<=t;casee++)
  {//cout<<"Case #"<<casee<<": ";
    solve();
  }

}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define ff first
#define ar array
#define ss second
#define ll long long int
#define mem(x) memset(x,0,sizeof(x))
#define setbits(x)  __builtin_popcount(x)
#define ull unsigned long long int
#define all(c) (c).begin(),(c).end()
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define db double
#define endl "\n"
#define  fbo(x) find_by_order(x)
#define  ook(x) order_of_key(x)

using namespace __gnu_pbds;
using namespace std;

typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os1;
typedef tree<int, null_type, greater<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os2;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair<ll,ll > iil;
typedef pair<ll,int> li;
typedef pair<int,int> ii;
inline void fast()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
const ll pi=31;
const ll MOD[2] = {1187278649, 1149736019};//for double hashing
const ll mod=(ll)(1e9)+7;
ll pmod(ll x,ll n){
  ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;
}
ll pMod(ll x,ll n,ll mod)
{ ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;

}

//think recursively also;
const int mxn=2e5;
ll n;
ll a[mxn+1];
ll dp[mxn+1][2];
set<ll>s;
ll dfs(ll u,ll id,ll add)
{
  if(u<=0 || u>n)
    return 0;
  int ty=add;
  if(ty==-1)
    ty=0;
   if(s.find(u)!=s.end())
   {
    return INT_MIN;
   }
  if(dp[u][ty]!=-1)
    return dp[u][ty];
  //dp[u][ty]=INT_MIN;
  s.insert(u);
  ll ans=0;
  ans+=a[u];
  ll pv=u;
  u+=add*a[u];
  ll c=dfs(u,id,-1LL*add);
  if(c==INT_MIN)
    ans=INT_MIN;
  else
    ans+=c;
  return dp[pv][ty]=ans;

}
void solve()
{
cin>>n;
for(int i=2;i<=n;i++)
{
  cin>>a[i];
}
memset(dp,-1,sizeof(dp));
 for(int i=1;i<n;i++)
 {
  s.clear();
   dp[1][1]=-1;
   a[1]=i;
   ll ans=dfs(1,i,1);
   if(ans==INT_MIN)
   {
    cout<<-1<<endl;
    continue;
   }
   //debug2(ans,i);

    cout<<ans<<endl;

 }
 // for(int i=1;i<n;i++)
 // {
 //  cout<<dp[i]<<endl;
 // }

}
int main()
{
  fast();
   // int t;
   // cin>>t;
   // for(int casee=1;casee<=t;casee++)
  {//cout<<"Case #"<<casee<<": ";
    solve();
  }

}


#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N = 2e5+10;

int n;
int a[N];
int DP[2*N][2];

int dp(int x,int sign){

   if( x<=0 || x>n ) return 0;
   if(DP[x][sign]!=-1) return DP[x][sign];

   int ans = -1e15;

   if(sign)
      ans = a[x] + dp(x-a[x], sign^1);
   else
      ans = a[x] + dp(x+a[x], sign^1);

   return DP[x][sign] = ans;
}

int32_t main(){

   IOS;

   cin>>n;
   memset(DP,-1,sizeof(DP));
   for(int i = 2;i<=n;i++) cin>>a[i];

   for(int i = 1;i<n;i++){

      int ans = i + dp(i+1,1);

      if(ans<0) ans = -1;

      cout<<ans<<endl;
   }

}


#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N = 200010;

int n;
int a[N];
int DP[2*N][2];

int dp(int x,int sign){

   if( x<=0 || x>n ) return 0;
   if(DP[x][sign]!=-1) return DP[x][sign];

   int ans = -1e15;

   if(sign)
      ans = a[x] + dp(x-a[x], sign^1);
   else
      ans = a[x] + dp(x+a[x], sign^1);

   return DP[x][sign] = ans;
}

int32_t main(){

   IOS;

   cin>>n;
   memset(DP,-1,sizeof(DP));
   for(int i = 2;i<=n;i++) cin>>a[i];

   for(int i = 1;i<n;i++){

      int ans = i + dp(i+1,1);

      if(ans<0) ans = -1;

      cout<<ans<<endl;
   }

}


#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N = 200010;

int n;
int a[N];
int DP[N][2];

int dp(int x,int sign){

   if( x<=0 || x>n ) return 0;

   int &ans = DP[x][sign];
   if(ans!=-1) return ans;
   ans = -1e13;

   if(sign)
      ans = a[x] + dp(x-a[x], sign^1);
   else
      ans = a[x] + dp(x+a[x], sign^1);

   return ans;
}

int32_t main(){

   IOS;

   cin>>n;
   memset(DP,-1,sizeof(DP));
   for(int i = 2;i<=n;i++) cin>>a[i];

   for(int i = 1;i<n;i++){

      int ans = i + dp(i+1,1);

      if(ans<0) ans = -1;

      cout<<ans<<endl;
   }

}


#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N = 200010;

int n;
int a[N];
int DP[N][2];

int dp(int x,int sign){

   if( x<=0 || x>n ) return 0;
   if(DP[x][sign]!=-1) return DP[x][sign];

   int ans = -1e15;

   if(sign)
      ans = a[x] + dp(x-a[x], sign^1);
   else
      ans = a[x] + dp(x+a[x], sign^1);

   return DP[x][sign] = ans;
}

int32_t main(){

   IOS;

   cin>>n;
   memset(DP,-1,sizeof(DP));
   for(int i = 2;i<=n;i++) cin>>a[i];

   for(int i = 1;i<n;i++){

      int ans = i + dp(i+1,1);

      if(ans<0) ans = -1;

      cout<<ans<<endl;
   }

}


//https://2no.co/2bjRx5
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#pragma GCC target("popcnt")  //https://godbolt.org/z/yQv94Y

typedef long long int ll;
typedef unsigned long long int  ull;
typedef long double ld;

const ld pi = 4.0*atan(1.0);
#define xlr8 ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cout.precision(10); cout<<fixed

typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
// T.insert(a), T.erase(a), T.size()
// T.order_of_key(a) -- number of elements strictly less than a
// *T.find_by_order(k) -- k-th element in increasing order

struct Timer
{   chrono::time_point<chrono::high_resolution_clock> start , end; chrono:: duration<float> dur;
    Timer(){start = chrono::high_resolution_clock::now();}
    ~Timer(){   end = chrono::high_resolution_clock::now(); dur = end - start;  cout<<"\nTime Elapsed : " <<dur.count() << " s\n";  }
};

template<typename T>
void getVec(vector<T>& a , int st, int en)
{
    int dif = (en > st ? 1 : -1);
    for(int  i = st ; i!= en ; i+= dif)
        cin>>a[i];
}
template<typename T>
void getVecPair(vector<pair<T , T > >& a , int st, int en)
{
    int dif = (en > st ? 1 : -1);
    for(int  i = st ; i!= en ; i+= dif)
        cin>>a[i].first>>a[i].second;
}

//76149
template<int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
  static_assert(D >= 1, "Vector dimension must be greater than zero!");
  template<typename... Args>
  Vec(int n = 0, Args... args) : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) {
  }
};
template<typename T>
struct Vec<1, T> : public vector<T> {
  Vec(int n = 0, T val = T()) : vector<T>(n, val) {
  }
};

// const int MAX = 1000;
// Vec<2 , int > dp(MAX + 1, MAX + 1, -1);

struct Graph
{
    int n;
    vector<vector<int> > adj;
    vector<int> a;

    Graph(int n)
    {
        this->n = n;
        adj.resize(n +  1);
        a.resize( n + 1);
    }

    void solve()
    {
        Vec<2 , ll > dp(n + 1, 2 , -1);
        Vec<2 , int> visited(n + 1 , 2 , 0);

        dp[1][1] = -2;
        visited[1][1] = 2;

        auto recur = [&](auto& Self , int i , int parity ) ->ll
        {
            if(i <=0 || i> n)
                return 0LL;

            else if(visited[i][parity] == 2)
                return dp[i][parity];

            else if(visited[i][parity] == 0)
            {
                visited[i][parity] = 1;
                ll ans = Self(Self ,adj[i][parity] , 1 - parity );
                visited[i][parity] = 2;
                return dp[i][parity] = ans + (a[i] == -2 ? 0LL : 1LL*a[i]);
            }
            else
            {
                visited[i][parity] = 2;
                return dp[i][parity] = -2;
            }
        };

        for(int i = 1; i<= n - 1; i++)
        {
            int tmp = recur(recur , i + 1 , 0 );
            if(tmp == -2)
                cout<<"-1\n";
            else
                cout<<i + tmp<<"\n";
        }
    }
};

int main()
{
   // xlr8;
    int testCases  = 1;
    //cin>>testCases;
    while (testCases--)
    {
        int n;
        cin>>n;
        Graph g(n);
        for(int i = 2; i<= n ; i++)
            cin>>g.a[i];
        for(int i =  2; i<= n ; i++)
        {
            g.adj[i].push_back(max(0 , i - g.a[i]));
            g.adj[i].push_back(min(n + 1 ,i + g.a[i] ));
        }
        g.solve();
    }
}


//https://2no.co/2bjRx5
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#pragma GCC target("popcnt")  //https://godbolt.org/z/yQv94Y

typedef long long int ll;
typedef unsigned long long int  ull;
typedef long double ld;

const ld pi = 4.0*atan(1.0);
#define xlr8 ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cout.precision(10); cout<<fixed

typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
// T.insert(a), T.erase(a), T.size()
// T.order_of_key(a) -- number of elements strictly less than a
// *T.find_by_order(k) -- k-th element in increasing order

struct Timer
{   chrono::time_point<chrono::high_resolution_clock> start , end; chrono:: duration<float> dur;
    Timer(){start = chrono::high_resolution_clock::now();}
    ~Timer(){   end = chrono::high_resolution_clock::now(); dur = end - start;  cout<<"\nTime Elapsed : " <<dur.count() << " s\n";  }
};

template<typename T>
void getVec(vector<T>& a , int st, int en)
{
    int dif = (en > st ? 1 : -1);
    for(int  i = st ; i!= en ; i+= dif)
        cin>>a[i];
}
template<typename T>
void getVecPair(vector<pair<T , T > >& a , int st, int en)
{
    int dif = (en > st ? 1 : -1);
    for(int  i = st ; i!= en ; i+= dif)
        cin>>a[i].first>>a[i].second;
}

//76149
template<int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
  static_assert(D >= 1, "Vector dimension must be greater than zero!");
  template<typename... Args>
  Vec(int n = 0, Args... args) : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) {
  }
};
template<typename T>
struct Vec<1, T> : public vector<T> {
  Vec(int n = 0, T val = T()) : vector<T>(n, val) {
  }
};

// const int MAX = 1000;
// Vec<2 , int > dp(MAX + 1, MAX + 1, -1);

struct Graph
{
    int n;
    vector<vector<ll> > adj;
    vector<ll> a;

    Graph(int n)
    {
        this->n = n;
        adj.resize(n +  1);
        a.resize( n + 1);
    }

    void solve()
    {
        Vec<2 , ll > dp(n + 1, 2 , -1);
        Vec<2 , int> visited(n + 1 , 2 , 0);

        dp[1][1] = -2;
        visited[1][1] = 2;

        auto recur = [&](auto& Self , int i , int parity )->ll
        {
            if(i <=0 || i> n)
                return 0;
            else if(visited[i][parity] == 2)
                return dp[i][parity];

            else if(visited[i][parity] == 0)
            {
                visited[i][parity] = 1;
                ll ans = Self(Self ,adj[i][parity] , 1 - parity );
                visited[i][parity] = 2;
                return dp[i][parity] = ans + (ans == -2 ? 0LL : a[i]);
            }
            else
            {
                visited[i][parity] = 2;
                return dp[i][parity] = -2;
            }
        };

        for(int i = 1; i<= n - 1; i++)
        {
            int tmp = recur(recur , i + 1 , 0 );
            if(tmp == -2)
                cout<<"-1\n";
            else
                cout<<i + tmp<<"\n";
        }
    }
};

int main()
{
   // xlr8;
    int testCases  = 1;
    //cin>>testCases;
    while (testCases--)
    {
        ll n;
        cin>>n;
        Graph g(n);
        for(int i = 2; i<= n ; i++)
            cin>>g.a[i];
        for(int i =  2; i<= n ; i++)
        {
            g.adj[i].push_back(max(0LL , i - g.a[i]));
            g.adj[i].push_back(min(n + 1 ,i + g.a[i] ));
        }
        g.solve();
    }
}


//https://2no.co/2bjRx5
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#pragma GCC target("popcnt")  //https://godbolt.org/z/yQv94Y

typedef long long int ll;
typedef unsigned long long int  ull;
typedef long double ld;

const ld pi = 4.0*atan(1.0);
#define xlr8 ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cout.precision(10); cout<<fixed

typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
// T.insert(a), T.erase(a), T.size()
// T.order_of_key(a) -- number of elements strictly less than a
// *T.find_by_order(k) -- k-th element in increasing order

struct Timer
{   chrono::time_point<chrono::high_resolution_clock> start , end; chrono:: duration<float> dur;
    Timer(){start = chrono::high_resolution_clock::now();}
    ~Timer(){   end = chrono::high_resolution_clock::now(); dur = end - start;  cout<<"\nTime Elapsed : " <<dur.count() << " s\n";  }
};

template<typename T>
void getVec(vector<T>& a , int st, int en)
{
    int dif = (en > st ? 1 : -1);
    for(int  i = st ; i!= en ; i+= dif)
        cin>>a[i];
}
template<typename T>
void getVecPair(vector<pair<T , T > >& a , int st, int en)
{
    int dif = (en > st ? 1 : -1);
    for(int  i = st ; i!= en ; i+= dif)
        cin>>a[i].first>>a[i].second;
}

//76149
template<int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
  static_assert(D >= 1, "Vector dimension must be greater than zero!");
  template<typename... Args>
  Vec(int n = 0, Args... args) : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) {
  }
};
template<typename T>
struct Vec<1, T> : public vector<T> {
  Vec(int n = 0, T val = T()) : vector<T>(n, val) {
  }
};

// const int MAX = 1000;
// Vec<2 , int > dp(MAX + 1, MAX + 1, -1);

struct Graph
{
    int n;
    vector<vector<int> > adj;
    vector<int> a;

    Graph(int n)
    {
        this->n = n;
        adj.resize(n +  1);
        a.resize( n + 1);
    }

    void solve()
    {
        Vec<2 , int > dp(n + 1, 2 , -1);
        Vec<2 , int> visited(n + 1 , 2 , 0);

        dp[1][1] = -2;
        visited[1][1] = 2;

        auto recur = [&](auto& Self , int i , int parity )
        {
            if(i <=0 || i> n)
                return 0;
            else if(visited[i][parity] == 2)
                return dp[i][parity];

            else if(visited[i][parity] == 0)
            {
                int ans = Self(Self ,adj[i][parity] , 1 - parity );
                if(ans == -2)
                    dp[i][parity] = ans;
                else
                    dp[i][parity] = a[i] + ans;
                visited[i][parity] = 2;
                return dp[i][parity];
            }
            else
            {
                visited[i][parity] = 2;
                return dp[i][parity] = -2;
            }
        };

        for(int i = 1; i<= n - 1; i++)
        {
            int tmp = recur(recur , i + 1 , 0 );
            if(tmp == -2)
                cout<<"-1\n";
            else
                cout<<i + tmp<<"\n";
        }
    }
};

int main()
{
   // xlr8;
    int testCases  = 1;
    //cin>>testCases;
    while (testCases--)
    {
        int n;
        cin>>n;
        Graph g(n);
        for(int i = 2; i<= n ; i++)
            cin>>g.a[i];
        for(int i =  2; i<= n ; i++)
        {
            g.adj[i].push_back(max(0 , i - g.a[i]));
            g.adj[i].push_back(min(n + 1 ,i + g.a[i] ));
        }
        g.solve();
    }
}


//https://2no.co/2bjRx5
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#pragma GCC target("popcnt")  //https://godbolt.org/z/yQv94Y

typedef long long int ll;
typedef unsigned long long int  ull;
typedef long double ld;

const ld pi = 4.0*atan(1.0);
#define xlr8 ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cout.precision(10); cout<<fixed

typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
// T.insert(a), T.erase(a), T.size()
// T.order_of_key(a) -- number of elements strictly less than a
// *T.find_by_order(k) -- k-th element in increasing order

struct Timer
{   chrono::time_point<chrono::high_resolution_clock> start , end; chrono:: duration<float> dur;
    Timer(){start = chrono::high_resolution_clock::now();}
    ~Timer(){   end = chrono::high_resolution_clock::now(); dur = end - start;  cout<<"\nTime Elapsed : " <<dur.count() << " s\n";  }
};

template<typename T>
void getVec(vector<T>& a , int st, int en)
{
    int dif = (en > st ? 1 : -1);
    for(int  i = st ; i!= en ; i+= dif)
        cin>>a[i];
}
template<typename T>
void getVecPair(vector<pair<T , T > >& a , int st, int en)
{
    int dif = (en > st ? 1 : -1);
    for(int  i = st ; i!= en ; i+= dif)
        cin>>a[i].first>>a[i].second;
}

//76149
template<int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
  static_assert(D >= 1, "Vector dimension must be greater than zero!");
  template<typename... Args>
  Vec(int n = 0, Args... args) : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) {
  }
};
template<typename T>
struct Vec<1, T> : public vector<T> {
  Vec(int n = 0, T val = T()) : vector<T>(n, val) {
  }
};

// const int MAX = 1000;
// Vec<2 , int > dp(MAX + 1, MAX + 1, -1);

struct Graph
{
    int n;
    vector<vector<int> > adj;
    vector<int> a;

    Graph(int n)
    {
        this->n = n;
        adj.resize(n +  1);
        a.resize( n + 1);
    }

    void solve()
    {
        Vec<2 , int > dp(n + 1, 2 , -1);
        Vec<2 , int> visited(n + 1 , 2 , 0);

        dp[1][1] = -2;
        visited[1][1] = 2;

        auto recur = [&](auto& Self , int i , int parity )
        {
            if(i <=0 || i> n)
                return 0;
            else if(visited[i][parity] == 2)
                return dp[i][parity];

            else if(visited[i][parity] == 0)
            {
                visited[i][parity] = 1;
                int ans = Self(Self ,adj[i][parity] , 1 - parity );
                if(ans == -2)
                    dp[i][parity] = ans;
                else
                    dp[i][parity] = a[i] + ans;
                visited[i][parity] = 2;
                return dp[i][parity];
            }
            else
            {
                visited[i][parity] = 2;
                return dp[i][parity] = -2;
            }
        };

        for(int i = 1; i<= n - 1; i++)
        {
            int tmp = recur(recur , i + 1 , 0 );
            if(tmp == -2)
                cout<<"-1\n";
            else
                cout<<i + tmp<<"\n";
        }
    }
};

int main()
{
   // xlr8;
    int testCases  = 1;
    //cin>>testCases;
    while (testCases--)
    {
        int n;
        cin>>n;
        Graph g(n);
        for(int i = 2; i<= n ; i++)
            cin>>g.a[i];
        for(int i =  2; i<= n ; i++)
        {
            g.adj[i].push_back(max(0 , i - g.a[i]));
            g.adj[i].push_back(min(n + 1 ,i + g.a[i] ));
        }
        g.solve();
    }
}


//https://2no.co/2bjRx5
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#pragma GCC target("popcnt")  //https://godbolt.org/z/yQv94Y

typedef long long int ll;
typedef unsigned long long int  ull;
typedef long double ld;

const ld pi = 4.0*atan(1.0);
#define xlr8 ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cout.precision(10); cout<<fixed

typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
// T.insert(a), T.erase(a), T.size()
// T.order_of_key(a) -- number of elements strictly less than a
// *T.find_by_order(k) -- k-th element in increasing order

struct Timer
{   chrono::time_point<chrono::high_resolution_clock> start , end; chrono:: duration<float> dur;
    Timer(){start = chrono::high_resolution_clock::now();}
    ~Timer(){   end = chrono::high_resolution_clock::now(); dur = end - start;  cout<<"\nTime Elapsed : " <<dur.count() << " s\n";  }
};

template<typename T>
void getVec(vector<T>& a , int st, int en)
{
    int dif = (en > st ? 1 : -1);
    for(int  i = st ; i!= en ; i+= dif)
        cin>>a[i];
}
template<typename T>
void getVecPair(vector<pair<T , T > >& a , int st, int en)
{
    int dif = (en > st ? 1 : -1);
    for(int  i = st ; i!= en ; i+= dif)
        cin>>a[i].first>>a[i].second;
}

//76149
template<int D, typename T>
struct Vec : public vector<Vec<D - 1, T>> {
  static_assert(D >= 1, "Vector dimension must be greater than zero!");
  template<typename... Args>
  Vec(int n = 0, Args... args) : vector<Vec<D - 1, T>>(n, Vec<D - 1, T>(args...)) {
  }
};
template<typename T>
struct Vec<1, T> : public vector<T> {
  Vec(int n = 0, T val = T()) : vector<T>(n, val) {
  }
};

// const int MAX = 1000;
// Vec<2 , int > dp(MAX + 1, MAX + 1, -1);

struct Graph
{
    int n;
    vector<vector<ll> > adj;
    vector<ll> a;

    Graph(int n)
    {
        this->n = n;
        adj.resize(n +  1);
        a.resize( n + 1);
    }

    void solve()
    {
        Vec<2 , ll > dp(n + 1, 2 , -1);
        Vec<2 , int> visited(n + 1 , 2 , 0);

        dp[1][1] = -2;
        visited[1][1] = 2;

        auto recur = [&](auto& Self , int i , int parity )->ll
        {
            if(i <=0 || i> n)
                return 0;
            else if(visited[i][parity] == 2)
                return dp[i][parity];

            else if(visited[i][parity] == 0)
            {
                visited[i][parity] = 1;
                ll ans = Self(Self ,adj[i][parity] , 1 - parity );
                visited[i][parity] = 2;
                return dp[i][parity] = ans + (ans == -2 ? 0LL : a[i]);
            }
            else
            {
                visited[i][parity] = 2;
                return dp[i][parity] = -2;
            }
        };

        for(ll i = 1; i<= n - 1; i++)
        {
            ll tmp = recur(recur , i + 1 , 0 );
            if(tmp == -2)
                cout<<"-1\n";
            else
                cout<<i + tmp<<"\n";
        }
    }
};

int main()
{
   // xlr8;
    int testCases  = 1;
    //cin>>testCases;
    while (testCases--)
    {
        ll n;
        cin>>n;
        Graph g(n);
        for(int i = 2; i<= n ; i++)
            cin>>g.a[i];
        for(int i =  2; i<= n ; i++)
        {
            g.adj[i].push_back(max(0LL , i - g.a[i]));
            g.adj[i].push_back(min(n + 1 ,i + g.a[i] ));
        }
        g.solve();
    }
}


#include<bits/stdc++.h>
#define ll long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int maxn=2e5+5;
int n,a[maxn],vis[maxn][5];
int dfs(int x,int y,int cnt){
	vis[x][cnt]=1;
	if(cnt%2==1){
		if(x-a[x]<=0||x-a[x]>n) {vis[x][0]=2;return y+a[x];}
		else if(!vis[x][0]) dfs(x-a[x],y+a[x],0);
		else return -1;
	}
	else if(cnt%2==0){
		if(x+a[x]<=0||x+a[x]>n) {vis[x][1]=2;return y+a[x];}
		else if(!vis[x][1]) dfs(x+a[x],y+a[x],1);
		else return -1;
	}
}
int main(){
	scanf("%d",&n);
	for(int i=2;i<=n;i++) scanf("%d",&a[i]);
	for(int i=1;i<n;i++){
		int X=1,Y=0;
		X+=i,Y+=i;
		printf("%d\n",dfs(X,Y,1));
	}
}


#include<bits/stdc++.h>
#define ll long long
#define int long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int maxn=2e5+5;
int n,a[maxn],vis[maxn][5];
int dfs(int x,int y,int cnt){
	vis[x][cnt]=1;
	if(cnt%2==1){
		if(x-a[x]<=0||x-a[x]>n) {vis[x][0]=2;return y+a[x];}
		else if(!vis[x][0]) dfs(x-a[x],y+a[x],0);
		else return -1;
	}
	else if(cnt%2==0){
		if(x+a[x]<=0||x+a[x]>n) {vis[x][1]=2;return y+a[x];}
		else if(!vis[x][1]) dfs(x+a[x],y+a[x],1);
		else return -1;
	}
}
signed main(){
	scanf("%lld",&n);
	for(int i=2;i<=n;i++) scanf("%lld",&a[i]);
	for(int i=1;i<n;i++){
		int X=1,Y=0;
		X+=i,Y+=i;
		printf("%lld\n",dfs(X,Y,1));
	}
}


#include<bits/stdc++.h>
#define ll long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int maxn=2e5+5;
int n,a[maxn],vis[maxn];
int dfs(int x,int y,int cnt){
	vis[x]=1;
	if(x<=0||x>n) return y;
	if(!vis[x-a[x]]&&cnt%2==1){
		if(x-a[x]<=0||x-a[x]>n) return y+a[x];
		else dfs(x-a[x],y+a[x],0);
	}
	else if(!vis[x+a[x]]&&cnt%2==0){
		if(x+a[x]<=0||x+a[x]>n) return y+a[x];
		else dfs(x+a[x],y+a[x],1);
	}
	else return -1;
}
int main(){
	scanf("%d",&n);
	for(int i=2;i<=n;i++) scanf("%d",&a[i]);
	for(int i=1;i<n;i++){
		int X=1,Y=0;
		X+=i,Y+=i;mem(vis,0);
		cout<<dfs(X,Y,1)<<endl;
	}
}


#include<bits/stdc++.h>
#define ll long long
#define int long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int maxn=2e5+5;
int n,a[maxn],vis[maxn][5];
int dfs(int x,int y,int cnt){
	vis[x][cnt]=1;
	if(cnt%2==1){
		if(x-a[x]<=0||x-a[x]>n) {vis[x][0]=2;return y+a[x];}
		else if(!vis[x][0]) dfs(x-a[x],y+a[x],0);
		else {vis[x][0]=2;return -1;}
	}
	else if(cnt%2==0){
		if(x+a[x]<=0||x+a[x]>n) {vis[x][1]=2;return y+a[x];}
		else if(!vis[x][1]) dfs(x+a[x],y+a[x],1);
		else {vis[x][1]=2;return -1;}
	}
}
signed main(){
	scanf("%lld",&n);
	for(int i=2;i<=n;i++) scanf("%lld",&a[i]);
	for(int i=1;i<n;i++){
		int X=1,Y=0;
		X+=i,Y+=i;
		printf("%lld\n",dfs(X,Y,1));
	}
}


#include<bits/stdc++.h>
#define ll long long
#define int long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int maxn=2e5+5;
int n,a[maxn],vis[maxn][5];
ll dfs(ll x,ll y,ll cnt){
	vis[x][cnt]=1;
	if(cnt%2==1){
		if(vis[x][0]==2) return -1;
		else if(x-a[x]<=0||x-a[x]>n) {vis[x][0]=2;return y+a[x];}
		else if(!vis[x][0]) dfs(x-a[x],y+a[x],0);
		else {vis[x][0]=2;return -1;}
	}
	else if(cnt%2==0){
		if(vis[x][1]==2) return -1;
		else if(x+a[x]<=0||x+a[x]>n) {vis[x][1]=2;return y+a[x];}
		else if(!vis[x][1]) dfs(x+a[x],y+a[x],1);
		else {vis[x][1]=2;return -1;}
	}
}
signed main(){
	scanf("%lld",&n);
	for(int i=2;i<=n;i++) scanf("%lld",&a[i]);
	for(int i=1;i<n;i++){
		int X=1,Y=0;
		X+=i,Y+=i;
		printf("%lld\n",dfs(X,Y,1));
	}
}


#include<bits/stdc++.h>
#define ll long long
#define int long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int maxn=2e5+5;
int n,a[maxn],vis[maxn][5];
ll dfs(ll x,ll y,ll cnt){
	vis[x][cnt]=1;
	if(cnt%2==1){
		if(x-a[x]<=0||x-a[x]>n) {vis[x][0]=2;return y+a[x];}
		else if(!vis[x][0]) dfs(x-a[x],y+a[x],0);
		else {vis[x][0]=2;return -1;}
	}
	else if(cnt%2==0){
		if(x+a[x]<=0||x+a[x]>n) {vis[x][1]=2;return y+a[x];}
		else if(!vis[x][1]) dfs(x+a[x],y+a[x],1);
		else {vis[x][1]=2;return -1;}
	}
}
signed main(){
	scanf("%lld",&n);
	for(int i=2;i<=n;i++) scanf("%lld",&a[i]);
	for(int i=1;i<n;i++){
		int X=1,Y=0;
		X+=i,Y+=i;
		printf("%lld\n",dfs(X,Y,1));
	}
}


#include<bits/stdc++.h>
#define ll long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int maxn=2e5+5;
int n,a[maxn],vis[maxn];
int dfs(int x,int y,int cnt){
	vis[x]=1;
	if(x<=0||x>n) return y;
	if(cnt%2==1){
		if(x-a[x]<=0||x-a[x]>n) return y+a[x];
		else if(!vis[x-a[x]]) dfs(x-a[x],y+a[x],0);
		else return -1;
	}
	else if(cnt%2==0){
		if(x+a[x]<=0||x+a[x]>n) return y+a[x];
		else if(!vis[x+a[x]]) dfs(x+a[x],y+a[x],1);
		else return -1;
	}
}
int main(){
	scanf("%d",&n);
	for(int i=2;i<=n;i++) scanf("%d",&a[i]);
	for(int i=1;i<n;i++){
		int X=1,Y=0;
		X+=i,Y+=i;mem(vis,0);
		cout<<dfs(X,Y,1)<<endl;
	}
}


#include<bits/stdc++.h>
#define ll long long
#define int long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int maxn=2e5+5;
int n,a[maxn],vis[maxn][5],dp[maxn][5];
void dfs(ll x,ll cnt){
	if(vis[x][cnt]) return ;
	vis[x][cnt]=1;
	int y;
	if(cnt==0) y=x-a[x];
	else  y=x+a[x];
	if(y<=0||y>n) dp[x][cnt]=a[x];
	else{
		dfs(y,cnt^1);
		if(dp[y][cnt^1]!=-1){
			dp[x][cnt]=dp[y][cnt^1]+a[x];
		}
	}
}
signed main(){
	scanf("%lld",&n);
	mem(dp,-1);
	for(int i=2;i<=n;i++) scanf("%lld",&a[i]);
	for(int i=2;i<=n;i++){
		dfs(i,0);
	}
	for(int i=2;i<=n;i++){
		if(dp[i][0]!=-1) {dp[i][0]+=i-1;}
		cout<<dp[i][0]<<endl;
	}
}


#include<bits/stdc++.h>
#define ll long long
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,n,a) for(int i=n;i>=a;i--)
#define endl '\n'
#define mem(a,b) memset(a,b,sizeof(a))
#define IO ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const int INF=0x3f3f3f3f;
const ll inf=0x3f3f3f3f3f3f3f3f;
const int mod=1e9+7;
const int maxn=2e5+5;
int n,a[maxn],vis[maxn];
int dfs(int x,int y,int cnt){
	vis[x]=1;
	if(x<=0||x>n) return y;
	if(!vis[x-a[x]]&&cnt%2==1) dfs(x-a[x],y+a[x],0);
	else if(!vis[x+a[x]]&&cnt%2==0) dfs(x+a[x],y+a[x],1);
	else return -1;
}
int main(){
	scanf("%d",&n);
	for(int i=2;i<=n;i++) scanf("%d",&a[i]);
	for(int i=1;i<n;i++){
		int X=1,Y=0;
		X+=i,Y+=i;mem(vis,0);
		cout<<dfs(X,Y,1)<<endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define vt vector
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()

const int INF = 1e9;
const int N = 2e5 + 1;

int n, color = 1;
int A[N], C[N][2];
ll dp[N][2];
bool flag;

ll dfs(int i, int s) {
  if (i < 1 or i > n) {
    return 0;
  }

  if (C[i][s] == color) {
    flag = 1;
    return -INF;
  }

  if (dp[i][s]) {
    return dp[i][s];
  }

  C[i][s] = color;
  //printf("i=%d\n", i);
  int sum = A[i];
  if (s) {
    sum += dfs(i - A[i], 1 - s);
  } else {
    sum += dfs(i + A[i], 1 - s);
  }
  return dp[i][s] = sum;
}

void solve() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> A[i];
  }

  for (int i = 1; i <= n - 1; i++) {
    //cout << "test case" << endl;
    A[1] = i;
    C[1][0] = color;
    int ans = i + dfs(1 + A[1], 1);
    if (flag) {
      cout << -1 << endl;
    } else {
      cout << ans << endl;
    }
    color++;
    flag = 0;
  }
}

int main(){solve();}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define vt vector
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()

const ll INF = 1e18;
const int N = 2e5 + 1;

int n, color = 1;
int A[N], C[N][2];
ll dp[N][2];
bool flag;

ll dfs(int i, int s) {
  if (i < 1 or i > n) {
    return 0;
  }

  if (C[i][s] == color) {
    flag = 1;
    return -INF;
  }

  if (dp[i][s] > 0) {
    return dp[i][s];
  } else if (dp[i][s] < 0) {
    flag = 1;
    return -INF;
  }

  C[i][s] = color;
  //printf("i=%d\n", i);
  ll sum = 0;
  if (s) {
    sum += dfs(i - A[i], 1 - s);
  } else {
    sum += dfs(i + A[i], 1 - s);
  }
  if (sum == INF) {
    return dp[i][s] = INF;
  } else {
    return dp[i][s] = A[i] + sum;
  }
}

void solve() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> A[i];
  }

  for (int i = 1; i <= n - 1; i++) {
    //cout << "test case" << endl;
    A[1] = i;
    ll ans = i + dfs(1 + A[1], 1);
    if (flag) {
      cout << -1 << endl;
    } else {
      cout << ans << endl;
    }
    color++;
    flag = 0;
  }
}

int main(){solve();}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define vt vector
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()

const ll INF = 1e17;
const int N = 2e5 + 1;

int n, color = 1;
int A[N], C[N][2];
ll dp[N][2];
bool flag;

ll dfs(int i, int s) {
  if (i < 1 or i > n) {
    return 0;
  }

  if (dp[i][s]) {
    return dp[i][s];
  }

  if (C[i][s] == color) {
    flag = 1;
    return -INF;
  }

  C[i][s] = color;
  //printf("i=%d\n", i);
  int sum = A[i];
  if (s) {
    sum += dfs(i - A[i], 1 - s);
  } else {
    sum += dfs(i + A[i], 1 - s);
  }
  return dp[i][s] = sum;
}

void solve() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> A[i];
  }

  for (int i = 1; i <= n - 1; i++) {
    //cout << "test case" << endl;
    A[1] = i;
    int ans = i + dfs(1 + A[1], 1);
    if (ans < 0) {
      cout << -1 << endl;
    } else {
      cout << ans << endl;
    }
    color++;
  }
}

int main(){solve();}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define vt vector
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()

const ll INF = 1e17;
const int N = 2e5 + 1;

int n, color = 1;
int A[N], C[N][2];
ll dp[N][2];
bool flag;

ll dfs(int i, int s) {
  if (i < 1 or i > n) {
    return 0;
  }

  if (C[i][s] == color) {
    flag = 1;
    return -INF;
  }

  if (dp[i][s] > 0) {
    return dp[i][s];
  } else if (dp[i][s] < 0) {
    flag = 1;
    return -INF;
  }

  C[i][s] = color;
  //printf("i=%d\n", i);
  int sum = A[i];
  if (s) {
    sum += dfs(i - A[i], 1 - s);
  } else {
    sum += dfs(i + A[i], 1 - s);
  }
  return dp[i][s] = sum;
}

void solve() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> A[i];
  }

  for (int i = 1; i <= n - 1; i++) {
    //cout << "test case" << endl;
    A[1] = i;
    int ans = i + dfs(1 + A[1], 1);
    if (flag) {
      cout << -1 << endl;
    } else {
      cout << ans << endl;
    }
    color++;
    flag = 0;
  }
}

int main(){solve();}


#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define vt vector
#define pb push_back
#define all(c) (c).begin(), (c).end()
#define sz(x) (int)(x).size()

const ll INF = 1e18;
const int N = 2e5 + 1;

int n, color = 1;
int A[N], C[N][2];
ll dp[N][2];
bool flag;

ll dfs(int i, int s) {
  if (i < 1 or i > n) {
    return 0;
  }

  if (C[i][s] == color) {
    flag = 1;
    return -INF;
  }

  if (dp[i][s] > 0) {
    return dp[i][s];
  } else if (dp[i][s] < 0) {
    flag = 1;
    return -INF;
  }

  C[i][s] = color;
  //printf("i=%d\n", i);
  ll sum = 0;
  if (s) {
    sum += dfs(i - A[i], 1 - s);
  } else {
    sum += dfs(i + A[i], 1 - s);
  }
  if (sum == INF) {
    return dp[i][s] = INF;
  } else {
    return dp[i][s] = A[i] + sum;
  }
}

void solve() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> A[i];
  }

  for (int i = 1; i <= n - 1; i++) {
    //cout << "test case" << endl;
    A[1] = i;
    int ans = i + dfs(1 + A[1], 1);
    if (flag) {
      cout << -1 << endl;
    } else {
      cout << ans << endl;
    }
    color++;
    flag = 0;
  }
}

int main(){solve();}


#include<bits/stdc++.h>
using namespace std;
#define int long long int
int dp[200100][2];
int dfs(int x,int y,vector<int> &a){
    if(x<1||x>=a.size()) return 0;
    int &ret=dp[x][y];
    if(ret) return ret;
    ret=-1;
    if(y) ret=dfs(x+a[x],0,a);
    else ret=dfs(x-a[x],1,a);
    return ret=ret+1?ret+a[x]:ret;
}

signed main(){
    int i,n; scanf("%I64d",&n);
    vector<int> a(n+1);
    for(i=2;i<=n;++i) scanf("%I64d",&a[i]);
    for(i=1;i<n;++i){
        a[1]=i; dp[1][1]=0;
        printf("%I64d\n",dfs(1,1,a));
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long int
int dp[200100][2];
int dfs(int x,int y,vector<int> &a){
    if(x<1||x>=a.size()) return 0;
    if(dp[x][y]) return dp[x][y];
    dp[x][y]=-1;
    int ret;
    if(y) ret=dfs(x+a[x],0,a);
    else ret=dfs(x-a[x],1,a);
    return dp[x][y]=ret+1?ret+a[x]:ret;
}

signed main(){
    int i,n; scanf("%I64d",&n);
    vector<int> a(n+1);
    for(i=2;i<=n;++i) scanf("%I64d",&a[i]);
    for(i=1;i<n;++i){
        a[1]=i; dp[1][1]=0;
        cout<<dfs(1,1,a)<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int dp[200100][2];
int dfs(int x,int y,vector<int> &a){
    if(x<1||x>=a.size()) return 0;
    int &ret=dp[x][y];
    if(ret) return ret;
    ret=-1;
    if(y) ret=dfs(x+a[x],0,a);
    else ret=dfs(x-a[x],1,a);
    return ret=ret+1?ret+a[x]:ret;
}

int main(){
    int i,n; scanf("%I64d",&n);
    vector<int> a(n+1);
    for(i=2;i<=n;++i) scanf("%I64d",&a[i]);
    for(i=1;i<n;++i){
        a[1]=i; dp[1][1]=0;
        cout<<dfs(1,1,a)<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int dp[1000010][2];
int dfs(int x,int y,vector<int> &a){
    if(x<1||x>a.size()-1) return 0;
    int &ret=dp[x][y];
    if(ret) return ret;
    ret=-1;
    if(y) ret=dfs(x+a[x],0,a);
    else ret=dfs(x-a[x],1,a);
    return ret+1?ret+a[x]:ret;
}

int main(){
    int i,n; scanf("%I64d",&n);
    vector<int> a(n+1);
    for(i=2;i<=n;++i) scanf("%I64d",&a[i]);
    for(i=1;i<n;++i){
        a[1]=i; dp[1][1]=0;
        cout<<dfs(1,1,a)<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int dp[200100][2];
int dfs(int x,int y,vector<int> &a){
    if(x<1||x>=a.size()) return 0;
    if(dp[x][y]) return dp[x][y];
    dp[x][y]=-1;
    int ret;
    if(y) ret=dfs(x+a[x],0,a);
    else ret=dfs(x-a[x],1,a);
    return dp[x][y]=ret+1?ret+a[x]:ret;
}

int main(){
    int i,n; scanf("%I64d",&n);
    vector<int> a(n+1);
    for(i=2;i<=n;++i) scanf("%I64d",&a[i]);
    for(i=1;i<n;++i){
        a[1]=i; dp[1][1]=0;
        cout<<dfs(1,1,a)<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define int long long int
int dp[200100][2];
int dfs(int x,int y,vector<int> &a){
    if(x<1||x>=a.size()) return 0;
    if(dp[x][y]) return dp[x][y];
    dp[x][y]=-1;
    int ret;
    if(y) ret=dfs(x+a[x],0,a);
    else ret=dfs(x-a[x],1,a);
    return dp[x][y]=ret+1?ret+a[x]:ret;
}

int main(){
    int i,n; scanf("%I64d",&n);
    vector<int> a(n+1);
    for(i=2;i<=n;++i) scanf("%I64d",&a[i]);
    for(i=1;i<n;++i){
        a[1]=i; dp[1][1]=0;
        cout<<dfs(1,1,a)<<endl;
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
#define INF 2e9
#define LINF 2e18
#define rep(i,j,n) for(int i = j; i < n; i++)
#define ll long long
#define pb push_back
#define ppb pop_back
#define pii pair<int,int>
#define all(c) (c).begin(),(c).end()
#define F first
#define S second
const long long MOD = 1e9 + 7;
const double err = 1e-12;
const double PI = 3.141592653589793;
const int N = 2e5 + 5;

int n;
vector<int> V(N);
vector<vector<ll>> dp(N,vector<ll>(2,-2));
vector<vector<int>> vis;

ll calc(int v, int dir){
   if(v > n || v <= 0) return 0;
   vis[v][dir]++;
   if(vis[v][dir] >= 2) return -1;
   if(dp[v][dir] != -2) {
      return dp[v][dir];
   }
   ll val = calc(v + V[v] * (dir == 0 ? 1 : -1), dir ^ 1);
   if(val == -1) return -1;
   else return val + (ll)V[v];
}

void solve(){
   cin >> n;
   rep(i,2,n+1){
      cin >> V[i];
   }
   for(int i = 1; i < n; i++){
      V[1] = i;
      vis = vector<vector<int>>(N,vector<int>(2,0));
      dp[1][0] = dp[1][1] = -2;
      cout << calc(1,0) << endl;
   }
}

int main(){
   //freopen("input.txt", "r", stdin);
   //freopen("output.txt", "w", stdout);
	FASTER;
   int t = 1;
   // cin >> t;
   while(t--) solve();
   return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
#define INF 2e9
#define LINF 2e18
#define rep(i,j,n) for(int i = j; i < n; i++)
#define ll long long
#define pb push_back
#define ppb pop_back
#define pii pair<int,int>
#define all(c) (c).begin(),(c).end()
#define F first
#define S second
const long long MOD = 1e9 + 7;
const double err = 1e-12;
const double PI = 3.141592653589793;
const int N = 2e5 + 5;

int n;
vector<int> V(N);
vector<vector<ll>> dp(N,vector<ll>(2,-2));
vector<vector<bool>> vis(N,vector<bool>(2,0));

ll calc(int v, int dir){
   if(v > n || v <= 0) return 0;
   if(vis[v][dir]) return dp[v][dir] = -1;
   vis[v][dir] = 1;
   if(dp[v][dir] != -2) {
      vis[v][dir] = 0;
      return dp[v][dir];
   }
   ll val = calc(v + V[v] * (dir == 0 ? 1 : -1), dir ^ 1);
   if(val == -1) {vis[v][dir] = 0; return dp[v][dir] = -1;}
   else {vis[v][dir] = 0; return dp[v][dir] = val + (ll)V[v];}
}

void solve(){
   cin >> n;
   rep(i,2,n+1){
      cin >> V[i];
   }
   for(int i = 1; i < n; i++){
      V[1] = i;
      dp[1][0] = dp[1][1] = -2;
      cout << calc(1,0) << endl;
   }
}

int main(){
   //freopen("input.txt", "r", stdin);
   //freopen("output.txt", "w", stdout);
	FASTER;
   int t = 1;
   // cin >> t;
   while(t--) solve();
   return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
#define INF 2e9
#define LINF 2e18
#define rep(i,j,n) for(int i = j; i < n; i++)
#define ll long long
#define pb push_back
#define ppb pop_back
#define pii pair<int,int>
#define all(c) (c).begin(),(c).end()
#define F first
#define S second
const long long MOD = 1e9 + 7;
const double err = 1e-12;
const double PI = 3.141592653589793;
const int N = 2e5 + 5;

int n;
vector<int> V(N);
vector<vector<ll>> dp(N,vector<ll>(2,0));
vector<vector<bool>> vis(N,vector<bool>(2,0));

int rec(int v, bool dir){
   if(vis[v][dir] == 1) return dp[v][dir] = -1ll;
   vis[v][dir] = 1;
   int nx = v + V[v] * (dir ? -1 : 1);
   if(nx <= 0 || nx > n){
      return dp[v][dir] = (ll)V[v];
   }
   else{
      if(dp[nx][dir^1] == 0) rec(nx, dir^1);
      if(dp[nx][dir^1] == -1) return dp[v][dir] = -1;
      else return dp[v][dir] = (ll)V[v] + dp[nx][dir^1];
   }
}

void solve(){
   cin >> n;
   rep(i,2,n+1){
      cin >> V[i];
   }
   for(int i = 2; i <= n; i++){
      if(dp[i][1] == 0){
         rec(i,1);
      }
   }
   for(int i = 1; i < n; i++){
      if(dp[1+i][1] == -1) cout << -1 << "\n";
      else cout << (ll)(i) + dp[1+i][1] << "\n";
   }
}

int main(){
   //freopen("input.txt", "r", stdin);
   //freopen("output.txt", "w", stdout);
	FASTER;
   int t = 1;
   // cin >> t;
   while(t--) solve();
   return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
#define INF 2e9
#define LINF 2e18
#define rep(i,j,n) for(int i = j; i < n; i++)
#define ll long long
#define pb push_back
#define ppb pop_back
#define pii pair<int,int>
#define all(c) (c).begin(),(c).end()
#define F first
#define S second
const long long MOD = 1e9 + 7;
const double err = 1e-12;
const double PI = 3.141592653589793;
const int N = 2e5 + 5;

int n;
vector<int> V(N);
vector<vector<ll>> dp(N,vector<ll>(2,-2));
vector<vector<int>> vis;

ll calc(int v, int dir){
   if(v > n || v <= 0) return 0;
   vis[v][dir]++;
   if(vis[v][dir] >= 2) return dp[v][dir] = -1;
   if(dp[v][dir] != -2) {
      return dp[v][dir];
   }
   ll val = calc(v + V[v] * (dir == 0 ? 1 : -1), dir ^ 1);
   if(val == -1) return dp[v][dir] = -1;
   else return dp[v][dir] = val + (ll)V[v];
}

void solve(){
   cin >> n;
   rep(i,2,n+1){
      cin >> V[i];
   }
   for(int i = 1; i < n; i++){
      V[1] = i;
      vis = vector<vector<int>>(N,vector<int>(2,0));
      dp[1][0] = dp[1][1] = -2;
      cout << calc(1,0) << endl;
   }
}

int main(){
   //freopen("input.txt", "r", stdin);
   //freopen("output.txt", "w", stdout);
	FASTER;
   int t = 1;
   // cin >> t;
   while(t--) solve();
   return 0;
}


#include "bits/stdc++.h"

using namespace std;

typedef vector <int> vi;
typedef long long ll;

int a[200005];
int n;
ll dp[200005][2];
bool vis[200005][2];

ll solve(int x, int p) {
    if (x <= 0 || x > n) return 0;

    if (x != 1 && dp[x][p] != 0) return dp[x][p];

    if (vis[x][p]) return -1;
    vis[x][p] = true;

    int aux = x + ((p == 0)? a[x]:-a[x]);

    ll res = solve(aux, !p);
    if (res == -1) return dp[x][p] = -1;

    dp[x][p] = res + a[x];
    return dp[x][p];
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;

    for (int i = 2; i <= n; i++){
        cin >> a[i];
    }

    for (int i = 1; i < n; i++){
        a[1] = i;
        memset(&vis, false, sizeof(vis));
        cout << solve(1, 0) << '\n';
    }
}


#include "bits/stdc++.h"

using namespace std;

typedef vector <int> vi;
typedef long long ll;

int a[200005];
int n;

bool vis[200005][2];

ll solve(int x, ll y) {
    if (x <= 0 || x > n){
        return y;
    }
    if (vis[x][0]) return -1;
    vis[x][0] = true;

    y += a[x];
    x += a[x];
    if (x <= 0 || x > n){
        return y;
    }
    if (vis[x][0]) return -1;
    vis[x][1] = true;

    y += a[x];
    x -= a[x];

    return solve(x,y);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;
    for (int i = 2; i <= n; i++){
        cin >> a[i];
    }
    for (int i = 1; i < n; i++){
        a[1] = i;
        memset(&vis, false, sizeof(vis));
        cout << solve(1, 0) << '\n';
    }
}

// 1 2 4 1
// +1-2

// 2 1 4 1
// +2-4

// 3 1 4 1
// +3-1+4


#include "bits/stdc++.h"

using namespace std;

typedef vector <int> vi;
typedef long long ll;

int a[200005];
int n;
ll dp[200005][2];
bool vis[200005][2];

ll solve(int x, int p) {
    if (x <= 0 || x > n) return 0;

    if (x != 1 && dp[x][p] != 0) return dp[x][p];

    if (vis[x][p]) return -1;
    vis[x][p] = true;

    int aux = x + ((p == 0)? a[x]:-a[x]);

    ll res = solve(aux, !p);
    if (res == -1) return dp[x][p] = -1;

    dp[x][p] = res + a[x];
    return dp[x][p];
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;

    for (int i = 2; i <= n; i++){
        cin >> a[i];
    }

    for (int i = 1; i < n; i++){
        a[1] = i;
        vis[1][0] = false;
        //vis[1][0] = false;
        cout << solve(1, 0) << '\n';
    }
}


#include "bits/stdc++.h"

using namespace std;

typedef vector <int> vi;
typedef long long ll;

int a[200005];
int n;

bool vis[200005][3];

ll solve(int x, ll y) {
    vis[x][1] = true;
    if (x <= 0 || x > n){
        return y;
    }
    y += a[x];
    x += a[x];
    if (x <= 0 || x > n){
        return y;
    }
    if (vis[x][2]) return -1;
    vis[x][2] = true;
    y += a[x];
    x -= a[x];
    if (vis[x][2]) return -1;
    return solve(x,y);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;
    for (int i = 2; i <= n; i++){
        cin >> a[i];
    }
    for (int i = 1; i < n; i++){
        a[1] = i;
        memset(&vis, false, sizeof(vis));
        cout << solve(1, 0) << endl;
    }
}

// 1 2 4 1
// +1-2

// 2 1 4 1
// +2-4

// 3 1 4 1
// +3-1+4


#include "bits/stdc++.h"

using namespace std;

typedef vector <int> vi;
typedef long long ll;

int a[200005];
int n;

bool vis[200005][3];

ll solve(int x, ll y) {
    vis[x][1] = true;
    if (x <= 0 || x > n){
        return y;
    }
    y += a[x];
    x += a[x];
    if (x <= 0 || x > n){
        return y;
    }
    if (vis[x][2]) return -1;
    vis[x][2] = true;
    y += a[x];
    x -= a[x];
    if (x <= 0 || x > n){
        return y;
    }
    if (vis[x][2]) return -1;
    return solve(x,y);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;
    for (int i = 2; i <= n; i++){
        cin >> a[i];
    }
    for (int i = 1; i < n; i++){
        a[1] = i;
        memset(&vis, false, sizeof(vis));
        cout << solve(1, 0) << endl;
    }
}

// 1 2 4 1
// +1-2

// 2 1 4 1
// +2-4

// 3 1 4 1
// +3-1+4


#include "bits/stdc++.h"

using namespace std;

typedef vector <int> vi;
typedef long long ll;

int a[200005];
int n;
ll dp[200005][2];
bool vis[200005][2];

ll solve(int x, int p) {
    if (x <= 0 || x > n) return 0;

    if (vis[x][p]) return -1;
    vis[x][p] = true;

    int aux = x + ((p == 0)? a[x]:-a[x]);

    ll res = solve(aux, !p);
    if (res == -1) return dp[x][p] = -1;
    else return dp[x][p] = res + a[x];
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;
    for (int i = 2; i <= n; i++){
        cin >> a[i];
    }
    for (int i = 1; i < n; i++){
        a[1] = i;
        memset(&vis, false, sizeof(vis));
        cout << solve(1, 0) << '\n';
    }
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
#define pb(x) push_back(x)
#define eb emplace_back
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend())
#define mp(x, y) make_pair(x, y)
#define INF 1000000000
#define MOD 1000000007
#define F(i, a, n) for(i=a;i<n;i++)
#define B(i, a, n) for(i=n-1;i>=0;i--)
#define SI(x) cin>>x
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define FI(w, x, y, z) cin>>w>>x>>y>>z
#define SO(x) cout<<x<<"\n"
#define DO(x, y) cout<<x<<" "<<y<<"\n"
#define TO(x, y, z) cout<<x<<" "<<y<<" "<<z<< "\n"
#define FO(w, x, y, z) cout<<w<<" "<<x<<" "<<y<<" "<<z<<"\n"
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

unordered_set<ll> forwardrecursion;
unordered_set<ll> backwardrecursion;

ll dfs(ll arr[], ll n, ll forward[], ll backward[], bool back, ll x)
{
    if(back)
    {
        if(backwardrecursion.count(x))
            return -1e17;
        backwardrecursion.insert(x);
        if(x - arr[x] <= 0)
            return arr[x];
        else if(forward[x - arr[x]] == -1)
            backward[x] = arr[x] + dfs(arr, n, forward, backward, false, x - arr[x]);
        return backward[x];
    }
    else
    {
        if(forwardrecursion.count(x))
            return -1e17;
        forwardrecursion.insert(x);
        if(x + arr[x] > n)
            return arr[x];
        else if(backward[x + arr[x]] == -1)
            forward[x] = arr[x] + dfs(arr, n, forward, backward, true, x + arr[x]);
        return forward[x];
    }

}

int main(void)
{
    FASTER;
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    ll i, j;
    ll n;
    SI(n);
    ll arr[n + 1];
    F(i, 2, n + 1)
        SI(arr[i]);
    ll forward[n + 1];
    ll backward[n + 1];
    F(i, 0, n + 1)
        forward[i] = backward[i] = -1;
    F(i, 1, n)
    {
        if(backward[i + 1] == -1)
        {
            forwardrecursion.clear();
            backwardrecursion.clear();
            forwardrecursion.insert(1);
            ll ans = dfs(arr, n, forward, backward, true, i + 1) + i;
            if(ans < 0)
                SO(-1);
            else
                SO(ans);
        }
        else
        {
            if(backward[i + 1] < 0)
                SO(-1);
            else
                SO(backward[i + 1] + i);
        }

    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
#define pb(x) push_back(x)
#define eb emplace_back
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend())
#define mp(x, y) make_pair(x, y)
#define INF 1000000000
#define MOD 1000000007
#define F(i, a, n) for(i=a;i<n;i++)
#define B(i, a, n) for(i=n-1;i>=0;i--)
#define SI(x) cin>>x
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define FI(w, x, y, z) cin>>w>>x>>y>>z
#define SO(x) cout<<x<<"\n"
#define DO(x, y) cout<<x<<" "<<y<<"\n"
#define TO(x, y, z) cout<<x<<" "<<y<<" "<<z<< "\n"
#define FO(w, x, y, z) cout<<w<<" "<<x<<" "<<y<<" "<<z<<"\n"
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

ll arr[200005];
bool inStack[200005][2];
ll dp[200005][2];
ll n;

ll dfs(ll x, ll forward)
{
    if(x == 1 && forward)
        return -1;
    if(x > n || x <= 0)
    {
        return 0;
    }
    if(inStack[x][forward])
    {
        dp[x][forward] = -1;
        return -1;
    }
    if(dp[x][forward] != -INF)
    {
        return dp[x][forward];
    }
    inStack[x][forward] = 1;
    if(forward)
    {
        dp[x][forward] = dfs(x + arr[x], forward ^ 1);
    }
    else
    {
        dp[x][forward] = dfs(x - arr[x], forward ^ 1);
    }
    if(dp[x][forward] != -1)
        dp[x][forward] += arr[x];
    inStack[x][forward] = 0;
    return dp[x][forward];

}

int main(void)
{
    FASTER;
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    ll i, j;
    SI(n);
    F(i, 2, n + 1)
        SI(arr[i]);
    F(i, 0, 200005)
        dp[i][0] = dp[i][1] = -INF;
    F(i, 1, n)
    {
        ll ans = dfs(i + 1, 0);
        if(ans != -1)
            ans += i;
        SO(ans);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
#define pb(x) push_back(x)
#define eb emplace_back
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend())
#define mp(x, y) make_pair(x, y)
#define INF 1000000000
#define MOD 1000000007
#define F(i, a, n) for(i=a;i<n;i++)
#define B(i, a, n) for(i=n-1;i>=0;i--)
#define SI(x) cin>>x
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define FI(w, x, y, z) cin>>w>>x>>y>>z
#define SO(x) cout<<x<<"\n"
#define DO(x, y) cout<<x<<" "<<y<<"\n"
#define TO(x, y, z) cout<<x<<" "<<y<<" "<<z<< "\n"
#define FO(w, x, y, z) cout<<w<<" "<<x<<" "<<y<<" "<<z<<"\n"
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

unordered_set<ll> forwardrecursion;
unordered_set<ll> backwardrecursion;

ll dfs(ll arr[], ll n, ll forward[], ll backward[], bool back, ll x)
{
    if(back)
    {
        if(backwardrecursion.count(x))
            return -1e17;
        backwardrecursion.insert(x);
        if(x - arr[x] <= 0)
            return arr[x];
        else if(forward[x - arr[x]] == -1)
            backward[x] = arr[x] + dfs(arr, n, forward, backward, false, x - arr[x]);
        return backward[x];
    }
    else
    {
        if(forwardrecursion.count(x))
            return -1e17;
        forwardrecursion.insert(x);
        if(x + arr[x] > n)
            return arr[x];
        else if(backward[x + arr[x]] == -1)
            forward[x] = arr[x] + dfs(arr, n, forward, backward, true, x + arr[x]);
        return forward[x];
    }

}

int main(void)
{
    FASTER;
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    ll i, j;
    ll n;
    SI(n);
    ll arr[n + 1];
    F(i, 2, n + 1)
        SI(arr[i]);
    ll forward[n + 1];
    ll backward[n + 1];
    F(i, 0, n + 1)
        forward[i] = backward[i] = -1;
    F(i, 1, n)
    {
        if(backward[i + 1] == -1)
        {
            forwardrecursion.clear();
            backwardrecursion.clear();
            forwardrecursion.insert(1);
            ll ans = dfs(arr, n, forward, backward, true, i + 1) + i;
            if(ans < 0)
                SO(-1);
            else
                SO(ans);
        }
        else
            SO(backward[i + 1] + i);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
#define pb(x) push_back(x)
#define eb emplace_back
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend())
#define mp(x, y) make_pair(x, y)
#define INF 1000000000
#define MOD 1000000007
#define F(i, a, n) for(i=a;i<n;i++)
#define B(i, a, n) for(i=n-1;i>=0;i--)
#define SI(x) cin>>x
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define FI(w, x, y, z) cin>>w>>x>>y>>z
#define SO(x) cout<<x<<"\n"
#define DO(x, y) cout<<x<<" "<<y<<"\n"
#define TO(x, y, z) cout<<x<<" "<<y<<" "<<z<< "\n"
#define FO(w, x, y, z) cout<<w<<" "<<x<<" "<<y<<" "<<z<<"\n"
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

ll arr[200005];
bool inStack[200005][2];
ll dp[200005][2];
ll n;

ll dfs(ll x, ll forward)
{
    if(x == 1 && forward)
        return -1;
    if(x > n || x <= 0)
    {
        return 0;
    }
    if(inStack[x][forward])
    {
        dp[x][forward] = -1;
        return -1;
    }
    inStack[x][forward] = 1;
    if(dp[x][forward] != -INF)
    {
        return dp[x][forward];
    }
    if(forward)
    {
        dp[x][forward] = dfs(x + arr[x], forward ^ 1);
        if(dp[x][forward] != -1)
            dp[x][forward] += arr[x];
    }
    else
    {
        dp[x][forward] = dfs(x - arr[x], forward ^ 1);
        if(dp[x][forward] != -1)
            dp[x][forward] += arr[x];
    }
    inStack[x][forward] = 0;
    return dp[x][forward];

}

int main(void)
{
    FASTER;
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    ll i, j;
    SI(n);
    F(i, 2, n + 1)
        SI(arr[i]);
    F(i, 0, 200005)
        dp[i][0] = dp[i][1] = -INF;
    F(i, 1, n)
    {
        ll ans = dfs(i + 1, 0);
        if(ans != -1)
            ans += i;
        SO(ans);
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
#define pb(x) push_back(x)
#define eb emplace_back
#define SORT(ls) sort(ls.begin(), ls.end())
#define DESC(ls) sort(ls.rbegin(), ls.rend())
#define mp(x, y) make_pair(x, y)
#define INF 1000000000
#define MOD 1000000007
#define F(i, a, n) for(i=a;i<n;i++)
#define B(i, a, n) for(i=n-1;i>=0;i--)
#define SI(x) cin>>x
#define DI(x, y) cin>>x>>y
#define TI(x, y, z) cin>>x>>y>>z
#define FI(w, x, y, z) cin>>w>>x>>y>>z
#define SO(x) cout<<x<<"\n"
#define DO(x, y) cout<<x<<" "<<y<<"\n"
#define TO(x, y, z) cout<<x<<" "<<y<<" "<<z<< "\n"
#define FO(w, x, y, z) cout<<w<<" "<<x<<" "<<y<<" "<<z<<"\n"
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)

ll arr[200005];
bool inStack[200005][2];
ll dp[200005][2];
ll n;

ll dfs(ll x, ll forward)
{
    if(x == 1 && forward)
        return -1;
    if(x > n || x <= 0)
    {
        return 0;
    }
    if(inStack[x][forward])
    {
        dp[x][forward] = -1;
        return -1;
    }
    if(dp[x][forward] != -INF)
    {
        return dp[x][forward];
    }
    inStack[x][forward] = 1;
    if(forward)
    {
        dp[x][forward] = dfs(x + arr[x], forward ^ 1);
        if(dp[x][forward] != -1)
            dp[x][forward] += arr[x];
    }
    else
    {
        dp[x][forward] = dfs(x - arr[x], forward ^ 1);
        if(dp[x][forward] != -1)
            dp[x][forward] += arr[x];
    }
    inStack[x][forward] = 0;
    return dp[x][forward];

}

int main(void)
{
    FASTER;
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    ll i, j;
    SI(n);
    F(i, 2, n + 1)
        SI(arr[i]);
    F(i, 0, 200005)
        dp[i][0] = dp[i][1] = -INF;
    F(i, 1, n)
    {
        ll ans = dfs(i + 1, 0);
        if(ans != -1)
            ans += i;
        SO(ans);
    }
    return 0;
}


 //#pragma comment(linker, "/stack:247474112")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>
using namespace std;

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;

//typedef tree<
//        pair<int, int>, // change type
//        null_type,
//        less<pair<int, int> >, // change type
//        rb_tree_tag,
//        tree_order_statistics_node_update>
//        ordered_set;

#define     pii             pair<int ,int>
#define     ff              first
#define     ss              second
#define     pb(x)           push_back(x )
#define     mp              make_pair
#define     sz(x)           x.size()
#define     clr(x)          x.clear()
#define     mem(x ,y)       memset(x , y , sizeof x )
#define     all(a )         a.begin() , a.end()
#define     endl            "\n"
#define     si(x )          scanf("%d", &x)
#define     sl(x )          scanf("%I64d", &x)
#define     sd(x )          scanf("%lf", &x)
#define     sii(x,y )       scanf("%d%d", &x,&y)
#define     siii(x,y ,z)    scanf("%d%d%d ", &x,&y , &z)
#define     rep(i ,n )      for(int i = 0 ; i < n ; i++ )
#define     repi(i ,n )     for(int i = 1 ; i <= n ; i++ )
#define     forn(i ,x,n )   for(int i = x ; i <= n ; i++ )
#define     repit(i, c)     for( __typeof((c).begin()) i = (c).begin(); i != (c).end();++i )
#define     dbg(args...)    do {   cerr << #args << ' ' ;  print(args); } while(0); cerr<< endl ;

typedef long long ll  ;
typedef unsigned long long  ull ;
typedef vector<int> vi  ;

const ll  mod =  1e9+7;
const int  inf = 1e9+7  ;
const long long  infL = 1e18 ;

int setbit(int n, int pos  ) { return n = n|(1<< pos) ; }
int resetbit(int n,int pos ) {  return n =  n & ~(1<<pos ); }
bool checkbit(int  n,int pos ) { return (bool ) (n&(1<<pos))  ; }

template < typename T > T mul(T x, T y   ) { x %= mod ; y %= mod ; return (x*y)%mod  ;  }
template < typename T > T add(T x, T y  ) { x %= mod ; y %= mod ; return (x+y)%mod ;  }
template < typename T > T modPow(T x, T k ,T mod ) { if(k == 0 ) return 1; if(k&1  ) { return ( (x%mod)*modPow(x,k-1, mod )%mod )%mod ; } else { T ret = modPow(x,k/2 , mod ) ; ret %= mod ; return (ret*ret )%mod; } }
template < typename T > T ext_gcd(T num1 , T num2, T &X , T &Y ) { T r2,r1, q2, q1 , x2, x1, y2 ,y1 , x,  y, r   ; x2 = 1; y2 = 0;  x1 = 0; y1 = 1; for( r2 =num1 ,r1 = num2 ;r1 != 0 ; y2 = y1, y1 = y,x2 = x1 ,x1 = x ,r2 = r1, r1 = r) {q1 = r2/r1; x = x2 - q1*x1; y = y2 - q1*y1; r = r2%r1 ; } X = x2 ; Y = y2 ; return r2 ;  }
template < typename T > T modInv( T x , T m ) {  return modPow(x,m-2 , m) ; }  // long long ret, t ;// ext_gcd( x, m ,ret ,t  ) ;// ret %= m ;// if(ret<0) ret += m  ; // return ret;}
template < typename T > void print(const T& v) {    cerr << v << ' ' ;}
template < typename T1, typename... T2 > void print( const T1& first, const T2&... rest ){ print(first); print(rest...) ;}
// debuging ...
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
    return os << "[ " << p.first << ", " << p.second << " ]";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
    os << "[ "; rep(i , sz( v)  )  os << v[i] << ' ' ; return os << " ]" ;
}

//int dx[] = {0 , 0 ,+1, -1 } ;
//int dy[] = {-1, +1,0 , 0 };

const int M = (int )3e5+7;
const int mx = (int)700;
const int nx  = 2000+ 77 ;

////  code from here ...

#define pos 0
#define neg 1

ll a[M+2] ,c[M+ 2 ]  , n  ;
ll  dp[M+2][2],vis[M+2][2] ;
ll func(int id, int pre) {
   // dbg(id,pre) ;

    if(id<1 or id>n ) return 0;
    ll  &ans = dp[id][pre ],&x =vis[id][pre] ;

    if(x==1 or id==1) return ans = -1 ;

    if(ans!=-1) return ans ;
    x =1;
    if(pre ==pos) {
        ll t= func(id-a[id],neg) ;
        ans = (t<0?t:t+a[id] );

    } else  {

        ll t = func(id+a[id] ,pos) ;
        ans = (t<0?t:t+a[id] ) ;

    }
    x= 0 ;

    return ans;
}

void solve() {
    int  q, y ,cnt,f= 1 ;
    cin>>n  ;
    forn(i ,2, n) cin>> a[i] ;
    mem(dp , -1) ;
    repi(i , n-1) {
        a[1] = i ;
        ll x = func(i+1,pos);
        //dbg("duck  ") ;
        if(x<0) cout << -1 <<endl ;
        else cout << x+i<<endl ;

    }

}

int main() {

    #ifndef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
     //   freopen("out.txt", "w", stdout);
    #endif
      ios::sync_with_stdio(false);  cin.tie(0); cout.tie(0);

    int t=1 , c= 0 ; // si( t) ;
    while(t--) {
       // printf("Case %d: ",++c)  ;
        solve() ;
    }

}


 //#pragma comment(linker, "/stack:247474112")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>
using namespace std;

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;

//typedef tree<
//        pair<int, int>, // change type
//        null_type,
//        less<pair<int, int> >, // change type
//        rb_tree_tag,
//        tree_order_statistics_node_update>
//        ordered_set;

#define     pii             pair<int ,int>
#define     ff              first
#define     ss              second
#define     pb(x)           push_back(x )
#define     mp              make_pair
#define     sz(x)           x.size()
#define     clr(x)          x.clear()
#define     mem(x ,y)       memset(x , y , sizeof x )
#define     all(a )         a.begin() , a.end()
#define     endl            "\n"
#define     si(x )          scanf("%d", &x)
#define     sl(x )          scanf("%I64d", &x)
#define     sd(x )          scanf("%lf", &x)
#define     sii(x,y )       scanf("%d%d", &x,&y)
#define     siii(x,y ,z)    scanf("%d%d%d ", &x,&y , &z)
#define     rep(i ,n )      for(int i = 0 ; i < n ; i++ )
#define     repi(i ,n )     for(int i = 1 ; i <= n ; i++ )
#define     forn(i ,x,n )   for(int i = x ; i <= n ; i++ )
#define     repit(i, c)     for( __typeof((c).begin()) i = (c).begin(); i != (c).end();++i )
#define     dbg(args...)    do {   cerr << #args << ' ' ;  print(args); } while(0); cerr<< endl ;

typedef long long ll  ;
typedef unsigned long long  ull ;
typedef vector<int> vi  ;

const ll  mod =  1e9+7;
const int  inf = 1e9+7  ;
const long long  infL = 1e18 ;

int setbit(int n, int pos  ) { return n = n|(1<< pos) ; }
int resetbit(int n,int pos ) {  return n =  n & ~(1<<pos ); }
bool checkbit(int  n,int pos ) { return (bool ) (n&(1<<pos))  ; }

template < typename T > T mul(T x, T y   ) { x %= mod ; y %= mod ; return (x*y)%mod  ;  }
template < typename T > T add(T x, T y  ) { x %= mod ; y %= mod ; return (x+y)%mod ;  }
template < typename T > T modPow(T x, T k ,T mod ) { if(k == 0 ) return 1; if(k&1  ) { return ( (x%mod)*modPow(x,k-1, mod )%mod )%mod ; } else { T ret = modPow(x,k/2 , mod ) ; ret %= mod ; return (ret*ret )%mod; } }
template < typename T > T ext_gcd(T num1 , T num2, T &X , T &Y ) { T r2,r1, q2, q1 , x2, x1, y2 ,y1 , x,  y, r   ; x2 = 1; y2 = 0;  x1 = 0; y1 = 1; for( r2 =num1 ,r1 = num2 ;r1 != 0 ; y2 = y1, y1 = y,x2 = x1 ,x1 = x ,r2 = r1, r1 = r) {q1 = r2/r1; x = x2 - q1*x1; y = y2 - q1*y1; r = r2%r1 ; } X = x2 ; Y = y2 ; return r2 ;  }
template < typename T > T modInv( T x , T m ) {  return modPow(x,m-2 , m) ; }  // long long ret, t ;// ext_gcd( x, m ,ret ,t  ) ;// ret %= m ;// if(ret<0) ret += m  ; // return ret;}
template < typename T > void print(const T& v) {    cerr << v << ' ' ;}
template < typename T1, typename... T2 > void print( const T1& first, const T2&... rest ){ print(first); print(rest...) ;}
// debuging ...
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
    return os << "[ " << p.first << ", " << p.second << " ]";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
    os << "[ "; rep(i , sz( v)  )  os << v[i] << ' ' ; return os << " ]" ;
}

//int dx[] = {0 , 0 ,+1, -1 } ;
//int dy[] = {-1, +1,0 , 0 };

const int M = (int )3e5+7;
const int mx = (int)700;
const int nx  = 2000+ 77 ;

////  code from here ...

#define pos 0
#define neg 1

ll a[M+2] ,c[M+ 2 ]  , n  ;
ll  dp[M+2][2],vis[M+2][2] ,d =0 ;
ll func(int id, int pre) {
   // dbg(id,pre) ;

    if(id<1 or id>n ) return 0;
    ll  &ans = dp[id][pre ],&x =vis[id][pre] ,t ;

    if(x==d or id==1) ans = -1 ;
    else if(x!=0)  {
        x=d;
        if(pre==0) t= func(id-a[id], 1) ;
        else t = func(id+a[id], 0) ;
        ans = (t<0?t: t+a[id]) ;
    }

    return ans;
}

void solve() {
    int  q, y ,cnt,f= 1 ;
    si( n ) ;
    forn(i ,2, n) si( a[i]) ;
   // mem(dp , -1) ;
    repi(i , n-1) {
        ++d ;
      //  a[1] = i ;
        ll x = func(i+1,pos);
        //dbg("duck  ") ;
        printf("%I64d\n" , (x<0?-1: x+i*1LL) ) ;

    }

}

int main() {

    #ifndef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
     //   freopen("out.txt", "w", stdout);
    #endif
     // ios::sync_with_stdio(false);  cin.tie(0); cout.tie(0);

    int t=1 , c= 0 ; // si( t) ;
    while(t--) {
       // printf("Case %d: ",++c)  ;
        solve() ;
    }

}


 //#pragma comment(linker, "/stack:247474112")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>
using namespace std;

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;

//typedef tree<
//        pair<int, int>, // change type
//        null_type,
//        less<pair<int, int> >, // change type
//        rb_tree_tag,
//        tree_order_statistics_node_update>
//        ordered_set;

#define     pii             pair<int ,int>
#define     ff              first
#define     ss              second
#define     pb(x)           push_back(x )
#define     mp              make_pair
#define     sz(x)           x.size()
#define     clr(x)          x.clear()
#define     mem(x ,y)       memset(x , y , sizeof x )
#define     all(a )         a.begin() , a.end()
#define     endl            "\n"
#define     si(x )          scanf("%d", &x)
#define     sl(x )          scanf("%I64d", &x)
#define     sd(x )          scanf("%lf", &x)
#define     sii(x,y )       scanf("%d%d", &x,&y)
#define     siii(x,y ,z)    scanf("%d%d%d ", &x,&y , &z)
#define     rep(i ,n )      for(int i = 0 ; i < n ; i++ )
#define     repi(i ,n )     for(int i = 1 ; i <= n ; i++ )
#define     forn(i ,x,n )   for(int i = x ; i <= n ; i++ )
#define     repit(i, c)     for( __typeof((c).begin()) i = (c).begin(); i != (c).end();++i )
#define     dbg(args...)    do {   cerr << #args << ' ' ;  print(args); } while(0); cerr<< endl ;

typedef long long ll  ;
typedef unsigned long long  ull ;
typedef vector<int> vi  ;

const ll  mod =  1e9+7;
const int  inf = 1e9+7  ;
const long long  infL = 1e18 ;

int setbit(int n, int pos  ) { return n = n|(1<< pos) ; }
int resetbit(int n,int pos ) {  return n =  n & ~(1<<pos ); }
bool checkbit(int  n,int pos ) { return (bool ) (n&(1<<pos))  ; }

template < typename T > T mul(T x, T y   ) { x %= mod ; y %= mod ; return (x*y)%mod  ;  }
template < typename T > T add(T x, T y  ) { x %= mod ; y %= mod ; return (x+y)%mod ;  }
template < typename T > T modPow(T x, T k ,T mod ) { if(k == 0 ) return 1; if(k&1  ) { return ( (x%mod)*modPow(x,k-1, mod )%mod )%mod ; } else { T ret = modPow(x,k/2 , mod ) ; ret %= mod ; return (ret*ret )%mod; } }
template < typename T > T ext_gcd(T num1 , T num2, T &X , T &Y ) { T r2,r1, q2, q1 , x2, x1, y2 ,y1 , x,  y, r   ; x2 = 1; y2 = 0;  x1 = 0; y1 = 1; for( r2 =num1 ,r1 = num2 ;r1 != 0 ; y2 = y1, y1 = y,x2 = x1 ,x1 = x ,r2 = r1, r1 = r) {q1 = r2/r1; x = x2 - q1*x1; y = y2 - q1*y1; r = r2%r1 ; } X = x2 ; Y = y2 ; return r2 ;  }
template < typename T > T modInv( T x , T m ) {  return modPow(x,m-2 , m) ; }  // long long ret, t ;// ext_gcd( x, m ,ret ,t  ) ;// ret %= m ;// if(ret<0) ret += m  ; // return ret;}
template < typename T > void print(const T& v) {    cerr << v << ' ' ;}
template < typename T1, typename... T2 > void print( const T1& first, const T2&... rest ){ print(first); print(rest...) ;}
// debuging ...
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
    return os << "[ " << p.first << ", " << p.second << " ]";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
    os << "[ "; rep(i , sz( v)  )  os << v[i] << ' ' ; return os << " ]" ;
}

//int dx[] = {0 , 0 ,+1, -1 } ;
//int dy[] = {-1, +1,0 , 0 };

const int M = (int )3e5+7;
const int mx = (int)700;
const int nx  = 2000+ 77 ;

////  code from here ...

#define pos 0
#define neg 1

ll a[M+2] ,c[M+ 2 ]  , n  ;
ll  dp[M+2][2],vis[M+2][2] ;
ll func(int id, int pre) {
   // dbg(id,pre) ;

    if(id<1 or id>n ) return 0;
    ll  &ans = dp[id][pre ],&x =vis[id][pre] ;

    if(x==1 or id==1) {
        return ans = -1 ;
    }
    x =1;
    if(pre ==pos) {
        ll t= func(id-a[id],neg) ;
        ans = (t<0?t:t+a[id] );

    } else  {

        ll t = func(id+a[id] ,pos) ;
        ans = (t<0?t:t+a[id] ) ;

    }
    x= 0 ;

    return ans;
}

void solve() {
    int  q, y ,cnt,f= 1 ;
    cin>>n  ;
    forn(i ,2, n) cin>> a[i] ;
    mem(dp , -1) ;
    repi(i , n-1) {
        a[1] = i ;
        ll x = func(i+1,pos);
        //dbg("duck  ") ;
        if(x<0) cout << -1 <<endl ;
        else cout << x+i<<endl ;

    }

}

int main() {

    #ifndef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
     //   freopen("out.txt", "w", stdout);
    #endif
      ios::sync_with_stdio(false);  cin.tie(0); cout.tie(0);

    int t=1 , c= 0 ; // si( t) ;
    while(t--) {
       // printf("Case %d: ",++c)  ;
        solve() ;
    }

}


 //#pragma comment(linker, "/stack:247474112")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>
using namespace std;

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;

//typedef tree<
//        pair<int, int>, // change type
//        null_type,
//        less<pair<int, int> >, // change type
//        rb_tree_tag,
//        tree_order_statistics_node_update>
//        ordered_set;

#define     pii             pair<int ,int>
#define     ff              first
#define     ss              second
#define     pb(x)           push_back(x )
#define     mp              make_pair
#define     sz(x)           x.size()
#define     clr(x)          x.clear()
#define     mem(x ,y)       memset(x , y , sizeof x )
#define     all(a )         a.begin() , a.end()
#define     endl            "\n"
#define     si(x )          scanf("%d", &x)
#define     sl(x )          scanf("%I64d", &x)
#define     sd(x )          scanf("%lf", &x)
#define     sii(x,y )       scanf("%d%d", &x,&y)
#define     siii(x,y ,z)    scanf("%d%d%d ", &x,&y , &z)
#define     rep(i ,n )      for(int i = 0 ; i < n ; i++ )
#define     repi(i ,n )     for(int i = 1 ; i <= n ; i++ )
#define     forn(i ,x,n )   for(int i = x ; i <= n ; i++ )
#define     repit(i, c)     for( __typeof((c).begin()) i = (c).begin(); i != (c).end();++i )
#define     dbg(args...)    do {   cerr << #args << ' ' ;  print(args); } while(0); cerr<< endl ;

typedef long long ll  ;
typedef unsigned long long  ull ;
typedef vector<int> vi  ;

const ll  mod =  1e9+7;
const int  inf = 1e9+7  ;
const long long  infL = 1e18 ;

int setbit(int n, int pos  ) { return n = n|(1<< pos) ; }
int resetbit(int n,int pos ) {  return n =  n & ~(1<<pos ); }
bool checkbit(int  n,int pos ) { return (bool ) (n&(1<<pos))  ; }

template < typename T > T mul(T x, T y   ) { x %= mod ; y %= mod ; return (x*y)%mod  ;  }
template < typename T > T add(T x, T y  ) { x %= mod ; y %= mod ; return (x+y)%mod ;  }
template < typename T > T modPow(T x, T k ,T mod ) { if(k == 0 ) return 1; if(k&1  ) { return ( (x%mod)*modPow(x,k-1, mod )%mod )%mod ; } else { T ret = modPow(x,k/2 , mod ) ; ret %= mod ; return (ret*ret )%mod; } }
template < typename T > T ext_gcd(T num1 , T num2, T &X , T &Y ) { T r2,r1, q2, q1 , x2, x1, y2 ,y1 , x,  y, r   ; x2 = 1; y2 = 0;  x1 = 0; y1 = 1; for( r2 =num1 ,r1 = num2 ;r1 != 0 ; y2 = y1, y1 = y,x2 = x1 ,x1 = x ,r2 = r1, r1 = r) {q1 = r2/r1; x = x2 - q1*x1; y = y2 - q1*y1; r = r2%r1 ; } X = x2 ; Y = y2 ; return r2 ;  }
template < typename T > T modInv( T x , T m ) {  return modPow(x,m-2 , m) ; }  // long long ret, t ;// ext_gcd( x, m ,ret ,t  ) ;// ret %= m ;// if(ret<0) ret += m  ; // return ret;}
template < typename T > void print(const T& v) {    cerr << v << ' ' ;}
template < typename T1, typename... T2 > void print( const T1& first, const T2&... rest ){ print(first); print(rest...) ;}
// debuging ...
template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
    return os << "[ " << p.first << ", " << p.second << " ]";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
    os << "[ "; rep(i , sz( v)  )  os << v[i] << ' ' ; return os << " ]" ;
}

//int dx[] = {0 , 0 ,+1, -1 } ;
//int dy[] = {-1, +1,0 , 0 };

const int M = (int )3e5+7;
const int mx = (int)700;
const int nx  = 2000+ 77 ;

////  code from here ...

#define pos 0
#define neg 1

ll a[M+2] ,c[M+ 2 ]  , n  ;
ll  dp[M+2][2],vis[M+2][2] ;
ll func(int id, int pre) {
   // dbg(id,pre) ;
    if(id<1 or id>n ) return 0;
    if(vis[id][pre ]==1){
        return dp[id ][pre] = -1e18 ;
    }
    vis[id][pre] =1 ;
    ll  &ans = dp[id][pre ] ;
    if(ans!=-1) return ans ;
    ans= 0;
    if(pre ==pos) {

        ans = func(id-a[id],neg)+a[id] ;

    } else  {
        ans = func(id+a[id] ,pos)+a[id] ;

    }

    vis[id][pre ]= 0 ;

    return ans;
}

void solve() {
    int  q, y ,cnt,f= 1 ;
    cin>>n  ;
    forn(i ,2, n) cin>> a[i] ;
    mem(dp , -1) ;
    repi(i , n-1) {
        a[1] = i ;
        ll x = func(i+1,pos)+i;
        //dbg("duck  ") ;
        if(x<0) cout << -1 <<endl ;
        else cout << x<<endl ;

    }

}

int main() {

    #ifndef ONLINE_JUDGE
        freopen("in.txt", "r", stdin);
     //   freopen("out.txt", "w", stdout);
    #endif
      ios::sync_with_stdio(false);  cin.tie(0); cout.tie(0);

    int t=1 , c= 0 ; // si( t) ;
    while(t--) {
       // printf("Case %d: ",++c)  ;
        solve() ;
    }

}