#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N=200010,M=100010;
int n,m,a[N],s[N],to[N];
int main () {
freopen("bzoj_2002.in","r",stdin);
freopen("bzoj_2002.out","w",stdout);
ios::sync_with_stdio(0);
cin.tie(0),cout.tie(0);
cin >> n;
for (int i=1;i<=n;i++) cin >> a[i];
cin >> m;
while (m--) {
int opt,p,q;
cin >> opt >> p;
p++;
if (opt==1) {
int sum=0;
while (p<=n) {
p+=a[p];
sum++;
}
cout << sum <<endl;
}else{
cin >> q;
a[p]=q;
}
}
return 0;
}