#include <iostream>
#include <cstdio>
using namespace std;
#define REP_1(i, n) for (int i=1;i<=int(n);++i)
#define REP_1_C(i, n) for (int n____=int(n),i=1;i<=n____;++i)
#define DO(N) while (N--)
#define DO_C(n) int n____ = n; while(n____--)
template<class T> inline void RD(T &x){char c; for (c = getchar(); c < '0'; c = getchar()); x = c - '0'; for (c = getchar(); c >= '0'; c = getchar()) x = x * 10 + c - '0';}
inline int RD(){ int x; RD(x); return x;}
template<class T> inline T& _RD(T &x){ RD(x); return x;}
template<class T0, class T1> inline void RD(T0 &x0, T1 &x1){RD(x0), RD(x1);}
template<class T> inline void OT(const T &x){printf("%d\n", x);}

/* .................................................................................................................................. */
const int N = 200001;

int l[N], r[N], p[N], sz[N]; bool rt[N] = {true};
int n, ans;

#define lx l[x]
#define rx r[x]

inline void Set(int l[], int y, int x){
    l[y] = x, p[x] = y;
}

inline void Rotate(int x){
    int y = p[x], z = p[y];

    if (!rt[y]) Set(y == l[z] ? l : r, z, x);
    else p[x] = z;

    if (x == l[y]){
        Set(l, y, rx), Set(r, x, y);
        sz[y] -= sz[x];
    }
    else {
        Set(r, y, lx), Set(l, x, y);
        sz[x] += sz[y];
    }

    if (rt[y]) rt[y] = false, rt[x] = true;
}

inline void Splay(int x){
    while (!rt[x]) Rotate(x);
}

void Access(int _x){
    int x = _x, y = 0;
    do{
        Splay(x), rt[r[x]] = true, rt[r[x] = y] = false;
        x = p[y = x];
    } while (x);

    Splay(_x);
}

void Link(int x, int y){
    Access(x), rt[l[x]] = true, sz[x] = 1;
    lx = p[lx] =  0, p[x] = y;
    Access(x);
}

void init(){
    REP_1_C(i, _RD(n)) sz[i] = 1, rt[i] = true;
    int k; REP_1(i, n){
        RD(k); if (i + k <= n) p[i] = i + k;
    }
}


int main(){
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    //ios::sync_with_stdio(false);

    init();

    int cmd, x, k;
    DO_C(RD()){

        RD(cmd, x), ++x;
        if (cmd == 1){
            Access(x), OT(sz[x]);
        }
        else {
            RD(k);
            if (x + k <= n) Link(x, x+k);
            else Link(x, 0);
        }
    }
}
