#include<bits/stdc++.h>
using namespace std;
auto IN = freopen("bzoj_2002.in", "r", stdin);
auto OUT = freopen("bzoj_2002.out", "w", stdout);
auto IOS = ios::sync_with_stdio(false);
auto CIN = cin.tie(nullptr);
int mread(){
int x = 0, f = 1;
char c = cin.get();
while(c < '0' || c > '9'){
if(c == '-'){
f = -1;
}
c = cin.get();
}
while(c >= '0' && c <= '9'){
x = x * 10 + c - '0';
c = cin.get();
}
return x * f;
}
const int N = 2e5 + 5;
int n = mread(), a[N], l[N], r[N], belong[N], b, nxt[N], len[N];
void build(int x){
for(int i = r[x]; i >= l[x]; i --){
if(i + a[i] > r[x]){
nxt[i] = i + a[i];
len[i] = 1;
}
else{
len[i] = len[i + a[i]] + 1;
nxt[i] = nxt[i + a[i]];
}
}
return;
}
int query(int x){
int ans = 0;
while(x <= n){
ans += len[x];
x = nxt[x];
}
return ans;
}
signed main(){
b = sqrt(n);
for(int i = 1; i <= n; i ++){
a[i] = mread();
}
for(int i = 1; i <= b; i ++){
l[i] = r[i - 1] + 1;
r[i] = l[i] + b - 1;
}
r[b] = n;
for(int i = 1; i <= b; i ++){
for(int j = l[i]; j <= r[i]; j ++){
belong[j] = i;
}
}
for(int i = 1; i <= b; i ++){
build(i);
}
int q = mread();
while(q --){
int op = mread();
if(op == 1){
int x = mread() + 1;
cout << query(x) << "\n";
}
else{
int p = mread() + 1, k = mread();
a[p] = k;
build(belong[p]);
}
}
return 0;
}