var
n,m,ans,i,j,k,l,now:longint;
a,next,long:array [1..200000] of longint;
function dep(k:longint):longint;
begin
exit((k-1) div l+1);
end;
function min(a,b:longint):longint;
begin
if a>b then exit(b)
else exit(a);
end;
begin
assign (input,'bzoj_2002.in');
assign (output,'bzoj_2002.out');
reset (input);
rewrite (output);
read(n);
for i:=1 to n do
read(a[i]);
l:=trunc(sqrt(n));
for i:=n downto 1 do
begin
if (dep(i+a[i])<>dep(i))or(i+a[i]>n) then
begin
long[i]:=1;
next[i]:=i+a[i];
end
else
begin
long[i]:=1+long[i+a[i]];
next[i]:=next[i+a[i]];
end;
end;
read(m);
for k:=1 to m do
begin
read(i);
if i=1 then
begin
read(now);
inc(now);
ans:=0;
while now<=n do
begin
ans:=ans+long[now];
now:=next[now];
end;
writeln(ans);
end
else
begin
read(j,now);
inc(j);
a[j]:=now;
for i:=min(n,dep(j)*l) downto (dep(j)-1)*l+1 do
begin
if (dep(i+a[i])<>dep(i))or(i+a[i]>n) then
begin
long[i]:=1;
next[i]:=i+a[i];
end
else
begin
long[i]:=1+long[i+a[i]];
next[i]:=next[i+a[i]];
end;
end;
end;
end;
close (input);
close (output);
end.