#include<bits/stdc++.h>
using namespace std;
#define int long long
int k[200005];
int to[200005];
int cnt[200005];
int sq;
int ingrp(int x){
return ceil(1.0*x/sq);
}
int findid(int x){
if(x%sq!=0)
return x%sq;
else
return sq;
}
signed main(){
ios::sync_with_stdio(false);
int n;
cin >> n;
sq=floor(1.0*sqrt(n));
for(int i=1;i<=n;i++){
cin >> k[i];
}
for(int i=n;i>=1;i--){
if(i+k[i]>n){
to[i]=n+1;
cnt[i]=1;
continue;
}
int nxt=i+k[i];
if(ingrp(i)==ingrp(nxt)){
to[i]=to[nxt];
cnt[i]=cnt[nxt]+1;
}
else{
to[i]=nxt;
cnt[i]=1;
}
}
int q;
cin >> q;
while(q--){
int opt;
cin >> opt;
if(opt==1){
int pos;
cin >> pos;
pos++;
int ans=0;
while(pos!=n+1){
ans+=cnt[pos];
pos=to[pos];
}
cout<<ans<<endl;
}
else{
int x,y;
cin >> x >> y;
x++;
k[x]=y;
int gp=ingrp(x);
int nxt=x+k[x];
if(nxt>n){
to[x]=n+1;
cnt[x]=1;
}
else{
if(gp==ingrp(nxt)){
to[x]=nxt;
cnt[x]=cnt[nxt]+1;
}
else{
to[x]=nxt;
cnt[x]=1;
}
}
for(int i=x-1;i>=1&&ingrp(i)==gp;i--){
if(i+k[i]>n){
to[i]=n+1;
cnt[i]=1;
continue;
}
int nt=i+k[i];
if(ingrp(i)==ingrp(nt)){
to[i]=to[nt];
cnt[i]=cnt[nt]+1;
}
else{
to[i]=nt;
cnt[i]=1;
}
}
}
}
}