#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<algorithm>
#define FOR(i,a,b) for(i=(a);i<=(b);i++)
#define ROF(i,a,b) for(i=(a);i>=(b);i--)
#define pb push_back
#define mp make_pair
#define N 600010
using namespace std;
typedef long long LL;
typedef long double LD;
int fa[N],tp[N],s[N],lc[N],rc[N],pp[N],n;
void upd(int x){s[0]=0;s[x]=s[lc[x]]+s[rc[x]]+1;}
void lt(int x)
{
int y=fa[x];tp[x]=tp[y];fa[x]=fa[y];tp[y]=1;fa[y]=x;pp[x]=pp[y];pp[y]=0;
s[x]=s[y];s[y]=s[rc[y]]+s[rc[x]]+1;
if (rc[x]!=0) {fa[rc[x]]=y;tp[rc[x]]=0;}
lc[y]=rc[x];rc[x]=y;
}
void rt(int x)
{
int y=fa[x];tp[x]=tp[y];fa[x]=fa[y];tp[y]=0;fa[y]=x;pp[x]=pp[y];pp[y]=0;
s[x]=s[y];s[y]=s[lc[y]]+s[lc[x]]+1;
if (lc[x]!=0) {fa[lc[x]]=y;tp[lc[x]]=1;}
rc[y]=lc[x];lc[x]=y;
}
void splay(int x)
{
while (fa[x])
{
if (tp[x]) rt(x);else lt(x);
}
}
void access(int v)
{
int u=v;v=0;
do
{
splay(u);
if (rc[u]) {pp[rc[u]]=u;fa[rc[u]]=0;}
rc[u]=v;
if (v){fa[v]=u;tp[v]=1;pp[v]=0;}
upd(u);
v=u;u=pp[u];
}while (u);
}
void cut_join(int v,int w)
{
access(v);
splay(v);
if (lc[v]) {fa[lc[v]]=0;lc[v]=0;}
upd(v);pp[v]=w;
access(v);
}
int main()
{
ios::sync_with_stdio(false);
int i,t,k1,k2,m,op;
scanf("%d",&n);
FOR(i,1,n+1) s[i]=1;
FOR(i,1,n)
{
scanf("%d",&t);
if (i+t>n)
{
cut_join(i,n+1);
}else
cut_join(i,i+t);
}
scanf("%d",&m);
FOR(i,1,m)
{
scanf("%d%d",&op,&k1);
k1++;
if (op==1)
{
access(k1);
splay(k1);
printf("%d\n",s[lc[k1]]);
}else
{
scanf("%d",&k2);
if (k1+k2>n) cut_join(k1,n+1);
else cut_join(k1,k1+k2);
}
}
return 0;
}