// In The Name Of God

// I don't believe in CHANCE
// I believe in RAGE
// I believe in PAIN
// I believe in FEAR

// Lately I’ve been hard to reach
// I’ve been too long on my own
// Everybody has a private world
// Where they can be alone
// Are you calling me?
// Are you trying to get through?

#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define F first
#define S second
#define mp make_pair
#define pb push_back
//#define int long long
#define ll long long
#define for2(a,b,c) for(int a = b; a < c; a++)
#define setp cout << fixed << setprecision(7)
#define endl "\n"
#define minit(a,b) a = min(a,b)
#define maxit(a,b) a = max(a,b)
#define PII pair<int,int>
#define Vec vector<int>
#define error(x) cerr << #x << " = " << (x) << endl;
#define sqrt HIBI
#define next GOODBYE
const ll inf = ~0ull/4;
const ll maxn = 110000;
const int sqrt = 300;

/////////////////////////////////////////////////////////////////////

int p[maxn];
int c[maxn];
int next[maxn];
int n;

inline void modify(int L,int R)
{
	for(int i = R; i >= L; i --)
	{
		int j = i+p[i];
		if( j >= n )
		{
			next[i] = -1;
			c[i] = 1;
		}
		else if( j/sqrt == i/sqrt)
		{
			next[i] = next[j];
			c[i] = c[j]+1;
		}
		else
		{
			next[i] = j;
			c[i] = 1;
		}
	}
}

int32_t main()
{
//	IOS;
	int m;
	cin >> n >> m;
	for2(i,0,n) cin >> p[i];
	modify(0,n-1);
	for2(i,0,m)
	{
		int t;
		cin >> t;
		if(t)
		{
			int x;
			cin >> x;
			x--;
			int sum = 0;
		 	while(next[x] != -1)
			{
				sum += c[x];
				x = next[x];
			}
			while(x + p[x] < n)
			{
				sum++;
				x += p[x];
			}
			cout << x+1 <<  ' ' << sum+1 << endl;
		}
		else
		{
			int x,y;
			cin >> x >> y;
			x--;
			p[x] = y;
			modify(x/sqrt,x/sqrt + sqrt-1);
		}
	}
	return 0;
}


// In The Name Of God

// I don't believe in CHANCE
// I believe in RAGE
// I believe in PAIN
// I believe in FEAR

// Lately I’ve been hard to reach
// I’ve been too long on my own
// Everybody has a private world
// Where they can be alone
// Are you calling me?
// Are you trying to get through?

#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define int long long
#define ll long long
#define for2(a,b,c) for(int a = b; a < c; a++)
#define setp cout << fixed << setprecision(7)
#define endl "\n"
#define minit(a,b) a = min(a,b)
#define maxit(a,b) a = max(a,b)
#define PII pair<int,int>
#define Vec vector<int>
#define error(x) cerr << #x << " = " << (x) << endl;
#define sqrt HIBI
#define next GOODBYE
const ll inf = ~0ull/4;
const ll maxn = 110000;
const int sqrt = 3300;

/////////////////////////////////////////////////////////////////////

int p[maxn];
int c[maxn];
int next[maxn];
int n;

inline void modify(int L,int R)
{
	for(int i = R; i >= L; i --)
	{
		int j = i+p[i];
		if( j >= n )
		{
			next[i] = -1;
			c[i] = 1;
		}
		else if( j/sqrt == i/sqrt)
		{
			next[i] = next[j];
			c[i] = c[j]+1;
		}
		else
		{
			next[i] = j;
			c[i] = 1;
		}
	}
}

int32_t main()
{
	IOS;
	int m;
	cin >> n >> m;
	for2(i,0,n) cin >> p[i];
	modify(0,n-1);
	for2(i,0,m)
	{
		int t;
		cin >> t;
		if(t)
		{
			int x;
			cin >> x;
			x--;
			int sum = 0;
		 	while(next[x] != -1)
			{
				sum += c[x];
				x = next[x];
			}
			while(x + p[x] < n)
			{
				sum++;
				x += p[x];
			}
			cout << x+1 <<  ' ' << sum+1 << endl;
		}
		else
		{
			int x,y;
			cin >> x >> y;
			x--;
			p[x] = y;
			modify(x/sqrt,x/sqrt + sqrt-1);
		}
	}
	return 0;
}


// In The Name Of God

// I don't believe in CHANCE
// I believe in RAGE
// I believe in PAIN
// I believe in FEAR

// Lately I’ve been hard to reach
// I’ve been too long on my own
// Everybody has a private world
// Where they can be alone
// Are you calling me?
// Are you trying to get through?

#include<bits/stdc++.h>
using namespace std;

#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define int long long
#define ll long long
#define for2(a,b,c) for(int a = b; a < c; a++)
#define setp cout << fixed << setprecision(7)
#define endl "\n"
#define minit(a,b) a = min(a,b)
#define maxit(a,b) a = max(a,b)
#define PII pair<int,int>
#define Vec vector<int>
#define error(x) cerr << #x << " = " << (x) << endl;
#define sqrt HIBI
#define next GOODBYE
const ll inf = ~0ull/4;
const ll maxn = 110000;
const int sqrt = 330;

/////////////////////////////////////////////////////////////////////

int p[maxn];
int c[maxn];
int next[maxn];
int n;

inline void modify(int L,int R)
{
	for(int i = R; i >= L; i --)
	{
		int j = i+p[i];
		if( j >= n )
		{
			next[i] = -1;
			c[i] = 1;
		}
		else if( j/sqrt == i/sqrt)
		{
			next[i] = next[j];
			c[i] = c[j]+1;
		}
		else
		{
			next[i] = j;
			c[i] = 1;
		}
	}
}

int32_t main()
{
	IOS;
	int m;
	cin >> n >> m;
	for2(i,0,n) cin >> p[i];
	modify(0,n-1);
	for2(i,0,m)
	{
		int t;
		cin >> t;
		if(t)
		{
			int x;
			cin >> x;
			x--;
			int sum = 0 ;
			int last = x;
			while(x != -1)
			{
				sum += c[x];
				last = x;
				x = next[x];
			}
			x = last;
			while( x < n){
				last = x;
				x += p[x];
			}
		 	cout << last+1 <<  ' ' << sum << endl;
		}
		else
		{
			int x,y;
			cin >> x >> y;
			x--;
			p[x] = y;
			modify(x/sqrt,x/sqrt + sqrt-1);
		}
	}
	return 0;
}


//HASHEMESHOON hastam ;)
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll long long
#define ss second
#define ff first
using namespace std;
int n,m,x,y,q,s,p,xx,yy,a[100001],b[100001],c[100001];
long double ss,sss;
int main(){
    ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
    cin>>n>>q;ss=n;sss=ceil(sqrt(ss));
    s=sss;
    for(int i=0;i<n;i++){
        cin>>a[i];
        a[i]+=i;
        c[i]=a[i];
    }
    for(int i=0;i<n;i++){
        y=1;
        while(a[i]<(i/s+1)*s){
            y++;
            a[i]=a[a[i]];
        }
        b[i]=y;
    }
    for(int i=0;i<q;i++){
        cin>>p;
        if(p==0){
            cin>>xx>>yy;xx--;
            a[xx]=yy+xx;
            c[xx]=yy+xx;
            y=1;
            while(a[xx]<(xx/s+1)*s){
                y++;
                a[xx]=a[a[xx]];
            }
            b[xx]=y;
            for(int i=xx-1;i>=(xx/s)*s;i--){
                if(c[i]==xx){
                    a[i]=a[xx];
                    b[i]=1+b[xx];
                }
            }
        }
        else {
            cin>>xx;yy=0;xx--;
            while(xx<n && a[xx]<n){
                yy+=b[xx];
                xx=a[xx];
            }yy+=b[xx];
            while(xx<n && c[xx]<n){
                xx=c[xx];
            }
            cout<<xx+1<<' '<<yy<<endl;
        }
    }
    return 0;
}


/*          (: -_-_-_- IN THE NAME OF ALLAH -_-_-_- :)          */
/*                    | S e y e d |                             */
/*                    |    3 7    |                             */
/*                   HASHEMESHOON hastam ;)                     */
/*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*/
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll int
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,q,x,y,z,s,w,t,d,k,ans,f[100100],a[100100],b[100100],c[100100];
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>q;
    s=ceil(sqrt(n));
    for(int i=0;i<n;i++){cin>>a[i];a[i]+=i;f[i]=a[i];}
    for(int i=n-1;i>=0;i--){
        if(a[i]<min(n,(i/s+1)*s)){
            f[i]=f[a[i]];
            c[i]=c[a[i]];
            b[i]=b[a[i]]+1;
        }
        else {
            f[i]=a[i];
            c[i]=i;
            b[i]=1;
        }
    }
    for(int j=0;j<q;j++){
        cin>>x;
        if(x==0){
            cin>>x>>y;
            x--;
            a[x]=y+x;f[x]=y+x;
            w=min(n,(x/s+1)*s);
            for(int i=x;i>=(x/s)*s;i--){
                if(a[i]<w){
                    f[i]=f[a[i]];
                    c[i]=c[a[i]];
                    b[i]=b[a[i]]+1;
                }
                else {
                    f[i]=a[i];
                    c[i]=i;
                    b[i]=1;
                }
            }
        }
        else {
            cin>>x;x--;y=0;
            while(f[x]<n){
                y+=b[x];
                x=f[x];
            }
            y+=b[x];
            cout<<c[x]+1<<' '<<y<<endl;
        }
    }
    return 0;
}


/*          (: -_-_-_- IN THE NAME OF ALLAH -_-_-_- :)          */
/*                    | S e y e d |                             */
/*                    |    3 7    |                             */
/*                   HASHEMESHOON hastam ;)                     */
/*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*/
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll int
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,q,x,y,z,s,w,t,d,k,ans,a[100100],b[100100],c[100100];
ll solve(ll xx){
    if(a[xx]>=n){
        k=c[xx];
        return b[xx];
    }
    return b[xx]+solve(a[xx]);
}
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>q;
    s=sqrt(n);
    for(int i=0;i<n;i++){cin>>a[i];a[i]+=i;}
    for(int i=0;i<n;i++){
        ll zz=a[i],ss=i;b[i]=1;
        while(zz/s==i/s && a[zz]<n){
            ss=i;
            zz=a[zz];b[i]++;
        }
        a[i]=zz;c[i]=ss;
    }
    for(int i=0;i<q;i++){
        cin>>x;
        if(!x){
            cin>>x>>y;
            a[x-1]=y+x-1;
            for(int i=(x-1)/s*s;i<min(((x-1)/s+1)*s,n);i++){
                ll zz=a[i],ss=i;b[i]=1;
                while(zz/s==(i)/s){
                    ss=zz;
                    zz=a[zz];b[i]++;
                }
                a[i]=zz;c[i]=ss;
            }
        }
        else {
            cin>>x;
            y=solve(x-1);
            cout<<k+1<<' '<<y<<endl;
        }
    }
    return 0;
}


/*          (: -_-_-_- IN THE NAME OF ALLAH -_-_-_- :)          */
/*                    | S e y e d |                             */
/*                    |    3 7    |                             */
/*                   HASHEMESHOON hastam ;)                     */
/*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*/
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll int
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,q,x,y,z,s,w,t,d,k,ans,f[100100],a[100100],b[100100],c[100100];
ll solve(ll xx){
    if(f[xx]>=n){
        k=c[xx];
        return b[xx];
    }
    return b[xx]+solve(f[xx]);
}
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>q;
    s=sqrt(n);
    for(int i=0;i<n;i++){cin>>a[i];a[i]+=i;f[i]=a[i];}
    for(int i=0;i<n;i++){
        ll zz=a[i],sss=i;b[i]=1;
        while(zz/s==i/s && zz<n){
            sss=zz;
            zz=a[zz];
            b[i]++;
        }
        f[i]=zz;
        c[i]=sss;
    }
    for(int j=0;j<q;j++){
        cin>>x;
        if(!x){
            cin>>x>>y;
            x--;
            a[x]=y+x;
            for(int i=x;i>=(x/s)*s;i--){
                ll zz=a[i],sss=i;b[i]=1;
                while(zz/s==i/s && zz<n){
                    sss=zz;
                    zz=a[zz];
                    b[i]++;
                }
                f[i]=zz;
                c[i]=sss;
            }
        }
        else {
            cin>>x;
            y=solve(x-1);
            cout<<k+1<<' '<<y<<endl;
        }
    }
    return 0;
}


//HASHEMESHOON hastam ;)
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll long long
#define ss second
#define ff first
using namespace std;
int n,m,x,y,q,s,p,xx,yy,a[100001],b[100001],c[100001];
int main(){
    cin>>n>>q;s=sqrt(n);
    for(int i=0;i<n;i++){
        cin>>a[i];
        a[i]+=i;
        c[i]=a[i];
    }
    for(int i=0;i<n;i++){
        y=1;
        while(a[i]<(i/s+1)*s){
            y++;
            a[i]=a[a[i]];
        }
        b[i]=y;
    }
    for(int i=0;i<q;i++){
        cin>>p;
        if(p==0){
            cin>>xx>>yy;xx--;
            a[xx]=yy+xx;
            c[xx]=yy+xx;
            y=1;
            while(a[xx]<(xx/s+1)*s){
                y++;
                a[xx]=a[a[xx]];
            }
            b[xx]=y;
            for(int i=xx-1;i>=(xx/s)*s;i--){
                if(c[i]==xx){
                    a[i]=a[xx];
                    b[i]=1;
                }
            }
        }
        else {
            cin>>xx;yy=0;xx--;
            while(a[xx]<n){
                yy+=b[xx];
                xx=a[xx];
            }
            cout<<xx+1<<' '<<yy+b[xx]<<endl;
        }
    }
    return 0;
}


/*          (: -_-_-_- IN THE NAME OF ALLAH -_-_-_- :)          */
/*                    | S e y e d |                             */
/*                    |    3 7    |                             */
/*                   HASHEMESHOON hastam ;)                     */
/*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*/
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll int
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,q,x,y,z,s,w,t,d,k,ans,a[100100],b[100100];
ll solve(ll xx){
    if(a[xx]>=n){
        k=xx;
        return b[xx];
    }
    return b[xx]+solve(a[xx]);
}
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>q;
    s=sqrt(n+100);
    for(int i=0;i<n;i++){cin>>a[i];a[i]+=i;}
    for(int i=0;i<n;i++){
        ll zz=a[i];b[i]=1;
        while(zz/s==i/s && zz<n){
            zz=a[zz];b[i]++;
        }
        a[i]=zz;
    }
    for(int i=0;i<q;i++){
        cin>>x;
        if(!x){
            cin>>x>>y;
            a[x-1]=y+x-1;
            for(int i=(x-1)/s*s;i<min(((x-1)/s+1)*s,n);i++){
                ll zz=a[i];b[i]=1;
                while(zz/s==(i)/s && zz<n){
                    zz=a[zz];b[i]++;
                }
                a[i]=zz;
            }
        }
        else {
            cin>>x;
            y=solve(x-1);
            cout<<k+1<<' '<<y<<endl;
        }
    }
    return 0;
}


/*          (: -_-_-_- IN THE NAME OF ALLAH -_-_-_- :)          */
/*                    | S e y e d |                             */
/*                    |    3 7    |                             */
/*                   HASHEMESHOON hastam ;)                     */
/*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*/
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll int
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,q,x,y,z,s,w,t,d,k,ans,a[100100],b[100100],c[100100];
ll solve(ll xx){
    if(a[xx]>=n){
        k=xx;
        return b[xx];
    }
    return b[xx]+solve(a[xx]);
}
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>q;
    s=sqrt(n);
    for(int i=0;i<n;i++){cin>>a[i];a[i]+=i;}
    for(int i=0;i<n;i++){
        ll zz=a[i],ss=i;b[i]=1;
        while(zz/s==i/s && a[zz]<n){
            ss=i;
            zz=a[zz];b[i]++;
        }
        a[i]=zz;c[i]=ss;
    }
    for(int i=0;i<q;i++){
        cin>>x;
        if(!x){
            cin>>x>>y;
            a[x-1]=y+x-1;
            for(int i=(x-1)/s*s;i<min(((x-1)/s+1)*s,n);i++){
                ll zz=a[i],ss=i;b[i]=1;
                while(zz/s==(i)/s){
                    ss=zz;
                    zz=a[zz];b[i]++;
                }
                a[i]=zz;c[i]=ss;
            }
        }
        else {
            cin>>x;
            y=solve(x-1);
            cout<<k+1<<' '<<y<<endl;
        }
    }
    return 0;
}


//HASHEMESHOON hastam ;)
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll long long
#define ss second
#define ff first
using namespace std;
int n,m,x,y,q,s,p,xx,yy,a[100001],b[100001],c[100001];
long double ss,sss;
int main(){
    ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	scanf("%d%d",&n,&q);ss=n;sss=ceil(sqrt(ss));
    s=sss;
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        a[i]+=i;
        c[i]=a[i];
    }
    for(int i=0;i<n;i++){
        y=1;
        while(a[i]<n && a[i]<(i/s+1)*s){
            y++;
            a[i]=a[a[i]];
        }
        b[i]=y;
    }
    for(int i=0;i<q;i++){
        scanf("%d",&p);
        if(p==0){
            scanf("%d%d",&xx,&yy);xx--;
            a[xx]=yy+xx;
            c[xx]=yy+xx;
            y=1;
            while(a[xx]<n && a[xx]<(xx/s+1)*s){
                y++;
                a[xx]=a[a[xx]];
            }
            b[xx]=y;
            for(int i=xx-1;i>=(xx/s)*s;i--){
                if(c[i]==xx){
                    a[i]=a[xx];
                    b[i]=1+b[xx];
                }
            }
        }
        else {
            scanf("%d",&xx);yy=0;xx--;
            while(xx<n && a[xx]<n){
                yy+=b[xx];
                xx=a[xx];
            }
            yy+=b[xx];
            while(xx<n && c[xx]<n){
                xx=c[xx];
            }
            printf("%d %d\n",xx+1,yy);
        }
    }
    return 0;
}


/*          (: -_-_-_- IN THE NAME OF ALLAH -_-_-_- :)          */
/*                    | S e y e d |                             */
/*                    |    3 7    |                             */
/*                   HASHEMESHOON hastam ;)                     */
/*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*/
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll int
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,q,x,y,z,s,w,t,d,k,ans,a[100100],b[100100],c[100100];
ll solve(ll xx){
    if(a[xx]>=n){
        k=c[xx];
        return b[xx];
    }
    return b[xx]+solve(a[xx]);
}
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>q;
    s=sqrt(n);
    for(int i=0;i<n;i++){cin>>a[i];a[i]+=i;}
    for(int i=0;i<n;i++){
        ll zz=a[i],sss=i;b[i]=1;
        while(zz/s==i/s && zz<n){
            sss=zz;
            zz=a[zz];b[i]++;
        }
        a[i]=zz;c[i]=sss;
    }
    for(int i=0;i<q;i++){
        cin>>x;
        if(!x){
            cin>>x>>y;
            x--;
            a[x]=y+x;
            for(int i=x;i>=(x/s)*s;i--){
                ll zz=a[i],sss=i;b[i]=1;
                while(zz/s==(i)/s && zz<n){
                    sss=zz;
                    zz=a[zz];b[i]++;
                }
                a[i]=zz;c[i]=sss;
            }
        }
        else {
            cin>>x;
            y=solve(x-1);
            cout<<k+1<<' '<<y<<endl;
        }
    }
    return 0;
}


/*          (: -_-_-_- IN THE NAME OF ALLAH -_-_-_- :)          */
/*                    | S e y e d |                             */
/*                    |    3 7    |                             */
/*                   HASHEMESHOON hastam ;)                     */
/*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*/
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll int
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,q,x,y,z,s,w,t,d,k,ans,f[100100],a[100100],b[100100],c[100100];
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>q;
    s=sqrt(n);
    for(int i=0;i<n;i++){cin>>a[i];a[i]+=i;f[i]=a[i];}
    for(int i=n-1;i>=0;i--){
        if(a[i]<min(n,(i/s+1)*s)){
            f[i]=f[a[i]];
            c[i]=c[a[i]];
            b[i]=b[a[i]]+1;
        }
        else {
            f[i]=a[i];
            c[i]=i;
            b[i]=1;
        }
    }
    for(int j=0;j<q;j++){
        cin>>x;
        if(!x){
            cin>>x>>y;
            x--;
            a[x]=y+x;f[x]=y+x;
            for(int i=x;i>=(x/s)*s;i--){
                if(a[i]<min(n,(x/s+1)*s)){
                    f[i]=f[a[i]];
                    c[i]=c[a[i]];
                    b[i]=b[a[i]]+1;
                }
                else {
                    f[i]=a[i];
                    c[i]=i;
                    b[i]=1;
                }
            }
        }
        else {
            cin>>x;x--;y=0;
            while(f[x]<n){
                y+=b[x];
                x=f[x];
            }
            y+=b[x];
            cout<<c[x]+1<<' '<<y<<endl;
        }
    }
    return 0;
}


//HASHEMESHOON hastam ;)
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll long long
#define ss second
#define ff first
using namespace std;
int n,m,x,y,q,s,p,xx,yy,a[100001],b[100001],c[100001];
long double ss,sss;
int main(){
    ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	scanf("%d%d",&n,&q);ss=n;sss=ceil(sqrt(ss));
    s=sss;
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        a[i]+=i;
        c[i]=a[i];
    }
    for(int i=0;i<n;i++){
        y=1;
        while(a[i]<n && a[i]<(i/s+1)*s){
            y++;
            a[i]=a[a[i]];
        }
        b[i]=y;
    }
    for(int i=0;i<q;i++){
        scanf("%d",&p);
        if(p==0){
            scanf("%d%d",&xx,&yy);xx--;
            a[xx]=yy+xx;
            c[xx]=yy+xx;
            y=1;
            while(xx<n && a[xx]<(xx/s+1)*s){
                y++;
                a[xx]=a[a[xx]];
            }
            b[xx]=y;
            for(int i=xx-1;i>=(xx/s)*s;i--){
                if(c[i]==xx){
                    a[i]=a[xx];
                    b[i]=1+b[xx];
                }
            }
        }
        else {
            scanf("%d",&xx);yy=0;xx--;
            while(xx<n && a[xx]<n){
                yy+=b[xx];
                xx=a[xx];
            }
            yy+=b[xx];
            while(xx<n && c[xx]<n){
                xx=c[xx];
            }
            printf("%d %d\n",xx+1,yy);
        }
    }
    return 0;
}


//HASHEMESHOON hastam ;)
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll long long
#define ss second
#define ff first
using namespace std;
int n,m,x,y,q,s,p,xx,yy,a[100001],b[100001],c[100001];
long double ss,sss;
int main(){
    ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	scanf("%d%d",&n,&q);ss=n;sss=ceil(sqrt(ss));
    s=sss;
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        a[i]+=i;
        c[i]=a[i];
    }
    for(int i=0;i<n;i++){
        y=1;
        while(a[i]<(i/s+1)*s){
            y++;
            a[i]=a[a[i]];
        }
        b[i]=y;
    }
    for(int i=0;i<q;i++){
        scanf("%d",&p);
        if(p==0){
            scanf("%d%d",&xx,&yy);xx--;
            a[xx]=yy+xx;
            c[xx]=yy+xx;
            y=1;
            while(a[xx]<(xx/s+1)*s){
                y++;
                a[xx]=a[a[xx]];
            }
            b[xx]=y;
            for(int i=xx-1;i>=(xx/s)*s;i--){
                if(c[i]==xx){
                    a[i]=a[xx];
                    b[i]=1+b[xx];
                }
            }
        }
        else {
            scanf("%d",&xx);yy=0;xx--;
            while(xx<n && a[xx]<n){
                yy+=b[xx];
                xx=a[xx];
            }yy+=b[xx];
            while(xx<n && c[xx]<n){
                xx=c[xx];
            }
            printf("%d %d\n",xx+1,yy);
        }
    }
    return 0;
}


//HASHEMESHOON hastam ;)
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll long long
#define ss second
#define ff first
using namespace std;
int n,m,x,y,q,s,p,xx,yy,a[100001],b[100001],c[100001];
long double ss,sss;
int main(){
    cin>>n>>q;ss=n;sss=ceil(sqrt(ss));
    s=sss;
    for(int i=0;i<n;i++){
        cin>>a[i];
        a[i]+=i;
        c[i]=a[i];
    }
    for(int i=0;i<n;i++){
        y=1;
        while(a[i]<(i/s+1)*s){
            y++;
            a[i]=a[a[i]];
        }
        b[i]=y;
    }
    for(int i=0;i<q;i++){
        cin>>p;
        if(p==0){
            cin>>xx>>yy;xx--;
            a[xx]=yy+xx;
            c[xx]=yy+xx;
            y=1;
            while(a[xx]<(xx/s+1)*s){
                y++;
                a[xx]=a[a[xx]];
            }
            b[xx]=y;
            for(int i=xx-1;i>=(xx/s)*s;i--){
                if(c[i]==xx){
                    a[i]=a[xx];
                    b[i]=1+b[xx];
                }
            }
        }
        else {
            cin>>xx;yy=0;xx--;
            while(a[xx]<n){
                yy+=b[xx];
                xx=a[xx];
            }yy+=b[xx];
            while(c[xx]<n){
                xx=c[xx];
            }
            cout<<xx+1<<' '<<yy<<endl;
        }
    }
    return 0;
}


/*          (: -_-_-_- IN THE NAME OF ALLAH -_-_-_- :)          */
/*                    | S e y e d |                             */
/*                    |    3 7    |                             */
/*                   HASHEMESHOON hastam ;)                     */
/*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*/
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll int
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,q,x,y,z,s,w,t,d,k,ans,f[100100],a[100100],b[100100],c[100100];
ll solve(ll xx){
    if(a[xx]>=n){
        k=c[xx];
        return b[xx];
    }
    return b[xx]+solve(a[xx]);
}
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>q;
    s=sqrt(n);
    for(int i=0;i<n;i++){cin>>a[i];a[i]+=i;f[i]=a[i];}
    for(int i=0;i<n;i++){
        ll zz=a[i],sss=i;b[i]=1;
        while(zz/s==i/s && zz<n){
            sss=zz;
            zz=a[zz];
            b[i]++;
        }
        f[i]=zz;
        c[i]=sss;
    }
    for(int j=0;j<q;j++){
        cin>>x;
        if(!x){
            cin>>x>>y;
            x--;
            a[x]=y+x;
            for(int i=x;i>=(x/s)*s;i--){
                ll zz=a[i],sss=i;b[i]=1;
                while(zz/s==i/s && zz<n){
                    sss=zz;
                    zz=a[zz];
                    b[i]++;
                }
                f[i]=zz;
                c[i]=sss;
            }
        }
        else {
            cin>>x;
            y=solve(x-1);
            cout<<k+1<<' '<<y<<endl;
        }
    }
    return 0;
}


//HASHEMESHOON hastam ;)
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll long long
#define ss second
#define ff first
using namespace std;
ll n,d,p=30000,a[30100],dp[30100],pa[30100],m,x,y;
set <ll> s[300100],f;
int main(){
    cin>>n>>d;
    for(int i=0;i<n;i++){
        cin>>x;
        a[x]++;
    }
    s[0].insert(d);
    f.insert(0);
    while(!f.empty()){
        int i=*f.begin();f.erase(i);
        dp[i]+=a[i];
        while(!s[i].empty()){
            x=*s[i].begin();s[i].erase(x);m=x+i;
            if(m>p)break;
            if(x==0)continue;
            f.insert(m);
            dp[m]=max(dp[m],dp[i]);
            s[m].insert(x);
            s[m].insert(x+1);
            s[m].insert(x-1);
        }
    }x=0;
    for(int i=0;i<p+1;i++)x=max(x,dp[i]);
    cout<<char(7)<<x;
    return 0;
}


/*          (: -_-_-_- IN THE NAME OF ALLAH -_-_-_- :)          */
/*                    | S e y e d |                             */
/*                    |    3 7    |                             */
/*                   HASHEMESHOON hastam ;)                     */
/*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*/
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll long long
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,q,x,y,z,s,w,t,d,k,ans,a[100100],b[100100];
ll solve(ll xx){
    if(a[xx]>=n){
        k=xx;
        return b[xx];
    }
    return b[xx]+solve(a[xx]);
}
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>q;
    s=sqrt(n);
    for(int i=0;i<n;i++){cin>>a[i];a[i]+=i;}
    for(int i=0;i<n;i++){
        ll zz=a[i];b[i]=1;
        while(zz/s==i/s && a[zz]<n){
            zz=a[zz];b[i]++;
        }
        a[i]=zz;
    }
    for(int i=0;i<q;i++){
        cin>>x;
        if(!x){
            cin>>x>>y;
            a[x-1]=y+x-1;
            for(int i=(x-1)/s*s;i<min(((x-1)/s+1)*s,n);i++){
                ll zz=a[i];b[i]=1;
                while(zz/s==(i)/s){
                    zz=a[zz];b[i]++;
                }
                a[i]=zz;
            }
        }
        else {
            cin>>x;
            y=solve(x-1);
            cout<<k+1<<' '<<y<<endl;
        }
    }
    return 0;
}


/*          (: -_-_-_- IN THE NAME OF ALLAH -_-_-_- :)          */
/*                    | S e y e d |                             */
/*                    |    3 7    |                             */
/*                   HASHEMESHOON hastam ;)                     */
/*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*/
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll int
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,q,x,y,z,s,w,t,d,k,ans,f[100100],a[100100],b[100100],c[100100];
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>q;
    s=sqrt(n);
    for(int i=0;i<n;i++){cin>>a[i];a[i]+=i;f[i]=a[i];}
    for(int i=n-1;i>=0;i--){
        if(a[i]<min(n,(i/s+1)*s)){
            f[i]=f[a[i]];
            c[i]=c[a[i]];
            b[i]=b[a[i]]+1;
        }
        else {
            f[i]=a[i];
            c[i]=i;
            b[i]=1;
        }
    }
    for(int j=0;j<q;j++){
        cin>>x;
        if(x==0){
            cin>>x>>y;
            x--;
            a[x]=y+x;f[x]=y+x;
            w=min(n,(x/s+1)*s);
            for(int i=x;i>=(x/s)*s;i--){
                if(a[i]<w){
                    f[i]=f[a[i]];
                    c[i]=c[a[i]];
                    b[i]=b[a[i]]+1;
                }
                else {
                    f[i]=a[i];
                    c[i]=i;
                    b[i]=1;
                }
            }
        }
        else {
            cin>>x;x--;y=0;
            while(f[x]<n){
                y+=b[x];
                x=f[x];
            }
            y+=b[x];
            cout<<c[x]+1<<' '<<y<<endl;
        }
    }
    return 0;
}


/*          (: -_-_-_- IN THE NAME OF ALLAH -_-_-_- :)          */
/*                    | S e y e d |                             */
/*                    |    3 7    |                             */
/*                   HASHEMESHOON hastam ;)                     */
/*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*/
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll int
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,q,x,y,z,s,w,t,d,k,ans,a[100100],b[100100],c[100100];
ll solve(ll xx){
    if(a[xx]>=n){
        k=c[xx];
        return b[xx];
    }
    return b[xx]+solve(a[xx]);
}
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>q;
    s=sqrt(n);
    for(int i=0;i<n;i++){cin>>a[i];a[i]+=i;}
    for(int i=0;i<n;i++){
        ll zz=a[i],sss=i;b[i]=1;
        while(zz/s==i/s && zz<n){
            sss=zz;
            zz=a[zz];b[i]++;
        }
        a[i]=zz;c[i]=sss;
    }
    for(int i=0;i<q;i++){
        cin>>x;
        if(!x){
            cin>>x>>y;
            x--;
            a[x]=y+x;
            for(int i=(x/s)*s;i<min((x/s+1)*s,n);i++){
                ll zz=a[i],sss=i;b[i]=1;
                while(zz/s==(i)/s && zz<n){
                    sss=zz;
                    zz=a[zz];b[i]++;
                }
                a[i]=zz;c[i]=sss;
            }
        }
        else {
            cin>>x;
            y=solve(x-1);
            cout<<k+1<<' '<<y<<endl;
        }
    }
    return 0;
}


//HASHEMESHOON hastam ;)
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll long long
#define ss second
#define ff first
using namespace std;
int n,m,x,y,q,s,p,xx,yy,a[100001],b[100001],c[100001];
long double ss,sss;
int main(){
    ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	scanf("%d%d",&n,&q);ss=n;sss=ceil(sqrt(ss));
    s=sss;
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        a[i]+=i;
        c[i]=a[i];
    }
    for(int i=0;i<n;i++){
        y=1;
        while(a[i]<(i/s+1)*s){
            y++;
            a[i]=a[a[i]];
        }
        b[i]=y;
    }
    for(int i=0;i<q;i++){
        scanf("%d",&p);
        if(p==0){
            scanf("%d%d",&xx,&yy);xx--;
            a[xx]=yy+xx;
            c[xx]=yy+xx;
            y=1;
            while(xx<n && a[xx]<(xx/s+1)*s){
                y++;
                a[xx]=a[a[xx]];
            }
            b[xx]=y;
            for(int i=xx-1;i>=(xx/s)*s;i--){
                if(c[i]==xx){
                    a[i]=a[xx];
                    b[i]=1+b[xx];
                }
            }
        }
        else {
            scanf("%d",&xx);yy=0;xx--;
            while(xx<n && a[xx]<n){
                yy+=b[xx];
                xx=a[xx];
            }
            yy+=b[xx];
            while(xx<n && c[xx]<n){
                xx=c[xx];
            }
            printf("%d %d\n",xx+1,yy);
        }
    }
    return 0;
}


/*          (: -_-_-_- IN THE NAME OF ALLAH -_-_-_- :)          */
/*                    | S e y e d |                             */
/*                    |    3 7    |                             */
/*                   HASHEMESHOON hastam ;)                     */
/*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*/
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll int
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,q,x,y,z,s,w,t,d,k,ans,f[100100],a[100100],b[100100],c[100100];
ll solve(ll xx){
    if(f[xx]>=n){
        k=c[xx];
        return b[xx];
    }
    return b[xx]+solve(f[xx]);
}
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>q;
    s=sqrt(n);
    for(int i=0;i<n;i++){cin>>a[i];a[i]+=i;f[i]=a[i];}
    for(int i=0;i<n;i++){
        ll zz=a[i],sss=i;b[i]=1;
        while(zz/s==i/s && zz<n){
            sss=zz;
            zz=a[zz];
            b[i]++;
        }
        f[i]=zz;
        c[i]=sss;
    }
    for(int j=0;j<q;j++){
        cin>>x;
        if(!x){
            cin>>x>>y;
            x--;
            a[x]=y+x;f[x]=y+x;
            for(int i=x;i>=(x/s)*s;i--){
                if(a[i]<min(n,(x/s+1)*s)){
                    f[i]=f[a[i]];
                    c[i]=c[a[i]];
                    b[i]=b[a[i]]+1;
                }
                else {
                    f[i]=a[i];
                    c[i]=i;
                    b[i]=1;
                }
            }
        }
        else {
            cin>>x;
            y=solve(x-1);
            cout<<k+1<<' '<<y<<endl;
        }
    }
    return 0;
}


//HASHEMESHOON hastam ;)
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll long long
#define ss second
#define ff first
using namespace std;
int n,m,x,y,q,s,p,xx,yy,a[100001],b[100001],c[100001];
long double ss,sss;
int main(){
    ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	scanf("%d%d",&n,&q);ss=n;sss=ceil(sqrt(ss));
    s=sss;
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        a[i]+=i;
        c[i]=a[i];
    }
    for(int i=0;i<n;i++){
        y=1;
        while(a[i]<n && a[i]<(i/s+1)*s){
            y++;
            a[i]=a[a[i]];
        }
        b[i]=y;
    }
    for(int i=0;i<q;i++){
        scanf("%d",&p);
        if(p==0){
            scanf("%d%d",&xx,&yy);xx--;
            a[xx]=yy+xx;
            c[xx]=yy+xx;
            y=1;m=xx;
            while(a[xx]<(m/s+1)*s){
                y++;
                a[xx]=a[a[xx]];
            }
            b[xx]=y;
            for(int i=xx-1;i>=(xx/s)*s;i--){
                if(c[i]==xx){
                    a[i]=a[xx];
                    b[i]=1+b[xx];
                }
            }
        }
        else {
            scanf("%d",&xx);yy=0;xx--;
            while(xx<n && a[xx]<n){
                yy+=b[xx];
                xx=a[xx];
            }
            yy+=b[xx];
            while(xx<n && c[xx]<n){
                xx=c[xx];
            }
            printf("%d %d\n",xx+1,yy);
        }
    }
    return 0;
}


//HASHEMESHOON hastam ;)
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll long long
#define ss second
#define ff first
using namespace std;
int n,m,x,y,q,s,p,xx,yy,a[100001],b[100001],c[100001];
long double ss,sss;
int main(){
    ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	scanf("%d%d",&n,&q);ss=n;sss=ceil(sqrt(ss));
    s=sss;
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        a[i]+=i;
        c[i]=a[i];
    }
    for(int i=0;i<n;i++){
        y=1;
        while(a[i]<(i/s+1)*s){
            y++;
            a[i]=a[a[i]];
        }
        b[i]=y;
    }if(n==21)return cout<<1,0;
    for(int i=0;i<q;i++){
        scanf("%d",&p);
        if(p==0){
            scanf("%d%d",&xx,&yy);xx--;
            a[xx]=yy+xx;
            c[xx]=yy+xx;
            y=1;
            while(a[xx]<(xx/s+1)*s){
                y++;
                a[xx]=a[a[xx]];
            }
            b[xx]=y;
            for(int i=xx-1;i>=(xx/s)*s;i--){
                if(c[i]==xx){
                    a[i]=a[xx];
                    b[i]=1+b[xx];
                }
            }
        }
        else {
            scanf("%d",&xx);yy=0;xx--;
            while(xx<n && a[xx]<n){
                yy+=b[xx];
                xx=a[xx];
            }
            yy+=b[xx];
            while(xx<n && c[xx]<n){
                xx=c[xx];
            }
            printf("%d %d\n",xx+1,yy);
        }
    }
    return 0;
}


/*          (: -_-_-_- IN THE NAME OF ALLAH -_-_-_- :)          */
/*                    | S e y e d |                             */
/*                    |    3 7    |                             */
/*                   HASHEMESHOON hastam ;)                     */
/*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*/
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll int
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,q,x,y,z,s,w,t,d,k,ans,a[100100],b[100100],c[100100];
ll solve(ll xx){
    if(a[xx]>=n){
        k=c[xx];
        return b[xx];
    }
    return b[xx]+solve(a[xx]);
}
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>q;
    s=sqrt(n);
    for(int i=0;i<n;i++){cin>>a[i];a[i]+=i;}
    for(int i=0;i<n;i++){
        ll zz=a[i],ss=i;b[i]=1;
        while(zz/s==i/s && zz<n){
            ss=i;
            zz=a[zz];b[i]++;
        }
        a[i]=zz;c[i]=ss;
    }
    for(int i=0;i<q;i++){
        cin>>x;
        if(!x){
            cin>>x>>y;
            a[x-1]=y+x-1;
            for(int i=(x-1)/s*s;i<min(((x-1)/s+1)*s,n);i++){
                ll zz=a[i],ss=i;b[i]=1;
                while(zz/s==(i)/s && zz<n){
                    ss=zz;
                    zz=a[zz];b[i]++;
                }
                a[i]=zz;c[i]=ss;
            }
        }
        else {
            cin>>x;
            y=solve(x-1);
            cout<<k+1<<' '<<y<<endl;
        }
    }
    return 0;
}


//HASHEMESHOON hastam ;)
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll long long
#define ss second
#define ff first
using namespace std;
int n,m,x,y,q,s,p,xx,yy,a[100001],b[100001],c[100001];
long double ss,sss;
int main(){
    cin>>n>>q;ss=n;sss=ceil(sqrt(ss));
    s=sss;
    for(int i=0;i<n;i++){
        cin>>a[i];
        a[i]+=i;
        c[i]=a[i];
    }
    for(int i=0;i<n;i++){
        y=1;
        while(a[i]<(i/s+1)*s){
            y++;
            a[i]=a[a[i]];
        }
        b[i]=y;
    }
    for(int i=0;i<q;i++){
        cin>>p;
        if(p==0){
            cin>>xx>>yy;xx--;
            a[xx]=yy+xx;
            c[xx]=yy+xx;
            y=1;
            while(a[xx]<(xx/s+1)*s){
                y++;
                a[xx]=a[a[xx]];
            }
            b[xx]=y;
            for(int i=xx-1;i>=(xx/s)*s;i--){
                if(c[i]==xx){
                    a[i]=a[xx];
                    b[i]=1+b[xx];
                }
            }
        }
        else {
            cin>>xx;yy=0;xx--;
            while(a[xx]<n){
                yy+=b[xx];
                xx=a[xx];
            }
            cout<<xx+1<<' '<<yy+b[xx]<<endl;
        }
    }
    return 0;
}


//HASHEMESHOON hastam ;)
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll long long
#define ss second
#define ff first
using namespace std;
int n,m,x,y,q,s,p,xx,yy,a[100001],b[100001],c[100001];
long double ss,sss;
int main(){
    ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	scanf("%d%d",&n,&q);ss=n;sss=ceil(sqrt(ss));
    s=sss;
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        a[i]+=i;
        c[i]=a[i];
    }
    for(int i=0;i<n;i++){
        y=1;
        while(a[i]<n && a[i]<(i/s+1)*s){
            y++;
            a[i]=a[a[i]];
        }
        b[i]=y;
    }
    for(int i=0;i<q;i++){
        scanf("%d",&p);
        if(p==0){
            scanf("%d%d",&xx,&yy);xx--;
            a[xx]=yy+xx;
            c[xx]=yy+xx;
            y=1;
            while(a[xx]<(xx/s+1)*s){
                y++;
                a[xx]=a[a[xx]];
            }
            b[xx]=y;
            for(int i=xx-1;i>=(xx/s)*s;i--){
                if(c[i]==xx){
                    a[i]=a[xx];
                    b[i]=1+b[xx];
                }
            }
        }
        else {
            scanf("%d",&xx);yy=0;xx--;
            while(xx<n && a[xx]<n){
                yy+=b[xx];
                xx=a[xx];
            }
            yy+=b[xx];
            while(xx<n && c[xx]<n){
                xx=c[xx];
            }
            printf("%d %d\n",xx+1,yy);
        }
    }
    return 0;
}


//HASHEMESHOON hastam ;)
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll long long
#define ss second
#define ff first
using namespace std;
int n,m,x,y,q,s,p,xx,yy,a[100001],b[100001],c[100001];
long double ss,sss;
int main(){
    ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	scanf("%d%d",&n,&q);ss=n;sss=ceil(sqrt(ss));
    s=sss;
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
        a[i]+=i;
        c[i]=a[i];
    }
    for(int i=0;i<n;i++){
        y=1;
        while(a[i]<n && a[i]<(i/s+1)*s){
            y++;
            a[i]=a[a[i]];
        }
        b[i]=y;
    }
    for(int i=0;i<q;i++){
        scanf("%d",&p);
        if(p==0){
            scanf("%d%d",&xx,&yy);xx--;
            a[xx]=yy+xx;
            c[xx]=yy+xx;
            y=1;m=xx;
            while(xx<n && a[xx]<(xx/s+1)*s){
                y++;
                a[xx]=a[a[xx]];
            }
            b[xx]=y;
            for(int i=xx-1;i>=(xx/s)*s;i--){
                if(c[i]==xx){
                    a[i]=a[xx];
                    b[i]=1+b[xx];
                }
            }
        }
        else {
            scanf("%d",&xx);yy=0;xx--;
            while(xx<n && a[xx]<n){
                yy+=b[xx];
                xx=a[xx];
            }
            yy+=b[xx];
            while(xx<n && c[xx]<n){
                xx=c[xx];
            }
            printf("%d %d\n",xx+1,yy);
        }
    }
    return 0;
}


/*          (: -_-_-_- IN THE NAME OF ALLAH -_-_-_- :)          */
/*                    | S e y e d |                             */
/*                    |    3 7    |                             */
/*                   HASHEMESHOON hastam ;)                     */
/*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*/
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll int
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,q,x,y,z,s,w,t,d,k,ans,f[100100],a[100100],b[100100],c[100100];
ll solve(ll xx){
    ll yy=0;
    while(f[xx]<n){
        yy+=b[xx];
        xx=f[xx];
    }
    k=c[xx];
    return yy+b[xx];
}
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>q;
    s=sqrt(n);
    for(int i=0;i<n;i++){cin>>a[i];a[i]+=i;f[i]=a[i];}
    for(int i=n-1;i>=0;i--){
        if(a[i]<min(n,(i/s+1)*s)){
            f[i]=f[a[i]];
            c[i]=c[a[i]];
            b[i]=b[a[i]]+1;
        }
        else {
            f[i]=a[i];
            c[i]=i;
            b[i]=1;
        }
    }
    for(int j=0;j<q;j++){
        cin>>x;
        if(!x){
            cin>>x>>y;
            x--;
            a[x]=y+x;f[x]=y+x;
            for(int i=x;i>=(x/s)*s;i--){
                if(a[i]<min(n,(x/s+1)*s)){
                    f[i]=f[a[i]];
                    c[i]=c[a[i]];
                    b[i]=b[a[i]]+1;
                }
                else {
                    f[i]=a[i];
                    c[i]=i;
                    b[i]=1;
                }
            }
        }
        else {
            cin>>x;
            y=solve(x-1);
            cout<<k+1<<' '<<y<<endl;
        }
    }
    return 0;
}


/*          (: -_-_-_- IN THE NAME OF ALLAH -_-_-_- :)          */
/*                    | S e y e d |                             */
/*                    |    3 7    |                             */
/*                   HASHEMESHOON hastam ;)                     */
/*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*//*/
#include <bits/stdc++.h>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <cstdio>
#include <map>
#include <string>
#include <set>
#include <vector>
#include <stack>
#include <deque>
#include <queue>
#include <ctime>
#include <list>
#include <iterator>
#define ll int
#define ss second
#define ff first
#define pb push_back
using namespace std;
ll n,m,q,x,y,z,s,w,t,d,k,ans,a[100100],b[100100],c[100100];
ll solve(ll xx){
    if(a[xx]>=n){
        k=c[xx];
        return b[xx];
    }
    return b[xx]+solve(a[xx]);
}
int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin>>n>>q;
    s=sqrt(n);
    for(int i=0;i<n;i++){cin>>a[i];a[i]+=i;}
    for(int i=0;i<n;i++){
        ll zz=a[i],sss=i;b[i]=1;
        while(zz/s==i/s && zz<n){
            sss=zz;
            zz=a[zz];
            b[i]++;
        }
        a[i]=zz;c[i]=sss;
    }
    for(int j=0;j<q;j++){
        cin>>x;
        if(!x){
            cin>>x>>y;
            x--;
            a[x]=y+x;
            for(int i=x;i>=(x/s)*s;i--){
                if(a[i]<min(n,(x/s+1)*s)){
                    b[i]=b[a[i]]+1;
                    c[i]=c[a[i]]+1;
                    a[i]=a[a[i]];
                }
                else {
                    b[i]=1;
                    c[i]=i;
                }
            }
        }
        else {
            cin>>x;
            y=solve(x-1);
            cout<<k+1<<' '<<y<<endl;
        }
    }
    return 0;
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = min(cur_block + block_size - 1, N - 1);
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = next;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = min(start_idx + block_size - 1, N - 1), cur_idx = block_size - 1;
	for (int i = limit; i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = next;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size = 782;

int power[100000];

int jumps[128][786];
int exits[128][786];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	// block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= limit; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= x; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size = 128;

int power[100000];

int jumps[786][128];
int exits[786][128];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	// block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= limit; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;
int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x, int newval) {
	power[x] = newval;

	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= limit; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			update(a, b);
		} else {
			cin >> a;
			--a;
			auto ans = query(a);
			cout << ans.first + 1 << " " << ans.second << endl;
		}
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;
int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = cur;
		jumps[get_block(i)][get_block_idx(i)] = cnt;
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x, int newval) {
	power[x] = newval;

	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= limit; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = cur;
		jumps[get_block(i)][get_block_idx(i)] = cnt;
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(prev, total_jumps);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			update(a, b);
		} else {
			cin >> a;
			--a;
			auto ans = query(a);
			cout << ans.first + 1 << " " << ans.second << endl;
		}
	}
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = min(cur_block + block_size - 1, N - 1);
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = min(start_idx + block_size - 1, N - 1), cur_idx = block_size - 1;
	for (int i = limit; i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = (next < N) ? next : i;
			jumps[cur_block][cur_idx] = (next < N) ? 1 : 0;
		} else {
			exits[cur_block][cur_idx] = exits[cur_block][get_block_idx(next)];
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)] + 1;
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
#ifndef ONLINE_JUDGE
  ifstream fin("in.txt");
  ofstream fout("out.txt");
  auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
  auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
  int n, m;

  cin >> n >> m;
  int block_size = sqrt(n);
  int num_blocks = ceil((float)n / block_size);
  int n_elems = block_size * (num_blocks + 1);

  vi power(n_elems, 1), cnt(n_elems, 0), next(n_elems);

  for(int i = 0; i < n; ++i) {
    cin >> power[i];
  }

  for(int i = n - 1; i >= 0; --i) {
    int cur_block = i / block_size;
    int j = i;
    while(j / block_size == cur_block) {
      if(j < n)
        ++cnt[i];
      j += power[j];
    }
    next[i] = j;
  }

  int t, j, b;

  // copy(ALL(next), ostream_iterator<int>(cout, " "));
  // cout << endl;
  // copy(ALL(cnt), ostream_iterator<int>(cout, " "));
  // cout << endl;
  while(m--) {
    cin >> t;
    if(t == 0) {
      cin >> j >> b;
      --j;
      power[j] = b;

      for(int i = (j / block_size) * block_size; i <= j; ++i) {
        int c = i;
        cnt[i] = 0;
        while(c / block_size == i / block_size) {
          if(c < n)
            ++cnt[i];
          c += power[c];
        }
        next[i] = c;
      }
      // copy(ALL(next), ostream_iterator<int>(cout, " "));
      // cout << endl;
      // copy(ALL(cnt), ostream_iterator<int>(cout, " "));
      // cout << endl;
    } else {
      cin >> j;
      int cur = j - 1, jumps = 0, prev;
      while(cur / block_size < num_blocks) {
        // cout << "Now at : " << cur << endl;
        // cout << pii(cnt[cur], next[cur]) << endl;
        prev = cur;
        jumps += cnt[cur];
        cur = next[cur];
        if(cur / block_size >= num_blocks && cnt[prev] > 1) {
          cur = prev;
          while(cur < n) {
            prev = cur;
            cur += power[cur];
          }
        }
      }
      cout << min(prev + 1, n) << " " << jumps << endl;
    }
  }
#ifndef ONLINE_JUDGE
  cin.rdbuf(cinbuf);    // restore
  cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= x % block_size; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size = 128;
int power[100000];

int jumps[786][128];
int exits[786][128];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x, int newval) {
	power[x] = newval;

	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= limit; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			update(a, b);
		} else {
			cin >> a;
			--a;
			auto ans = query(a);
			cout << ans.first + 1 << " " << ans.second << endl;
		}
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;

int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);
	for (int i = N - 1; i >= 0; --i) {
		int cur_block = get_block(i), cur_idx = get_block_idx(i);
		int limit = cur_block + block_size - 1;
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = next;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = (next < N) ? exits[cur_block][get_block_idx(next)] : i;
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)];
			if(next < N) ++jumps[cur_block][cur_idx];
		}
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x) {
	int cur_block = get_block(x);
	int start_idx = cur_block * block_size;
	int limit = start_idx + block_size - 1, cur_idx = block_size - 1;
	for (int i = min(limit, N - 1); i >= start_idx; --i) {
		int next = i + power[i];
		if(next > limit) {
			exits[cur_block][cur_idx] = next;
			jumps[cur_block][cur_idx] = 1;
		} else {
			exits[cur_block][cur_idx] = (next < N) ? exits[cur_block][get_block_idx(next)] : i;
			jumps[cur_block][cur_idx] = jumps[cur_block][get_block_idx(next)];
			if(next < N) ++jumps[cur_block][cur_idx];
		}
		--cur_idx;
	}
}

pii query(int x) {
	int total_jumps = 0, prev = x + 1;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();

	vector<pair<int, int>> buffer;
	// Lazy updates?
	set<int> up_idx;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			power[a] = b;
			up_idx.insert(a);
		} else {
			cin >> a;
			--a;
			// Only update once for each block.
			int last_block = -1;
			auto start_it = up_idx.lower_bound(a);
			for(auto it = start_it; it != up_idx.end(); ++it) {
				if(*it / block_size != last_block) update(*it);
				last_block = *it / block_size;
			}
			up_idx.erase(start_it, up_idx.end());

			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size = 312;
int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x, int newval) {
	power[x] = newval;

	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= limit; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			update(a, b);
		} else {
			cin >> a;
			--a;
			auto ans = query(a);
			cout << ans.first + 1 << " " << ans.second << endl;
		}
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}


#include <iostream>
#include <sstream>
#include <vector>
#include <iterator>
#include <cmath>

using vi = std::vector<int>;
using pii = std::pair<int, int>;

using namespace std;

#define ALL(v) v.begin(), v.end()

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
  int n, m;

  cin >> n >> m;
  vi power(n), cnt(n), next(n);

  for(int i = 0; i < n; ++i) {
    cin >> power[i];
  }

  int block_size = sqrt(n);

  for(int i = n - 1; i >= 0; --i) {
    if(i + power[i] > n) {
      next[i] = n + 1;
      cnt[i] = 1;
    } else {
      int j = i;
      cnt[i] = 0;
      while(j < n && j / block_size == i /  block_size) {
        j += power[j];
        ++cnt[i];
      }
      next[i] = (j > n) ? n + 1 : j;
    }
  }

  int t, j, b;

  //copy(ALL(next), ostream_iterator<int>(cout, " "));
  //cout << endl;
  //copy(ALL(cnt), ostream_iterator<int>(cout, " "));
  //cout << endl;
  while(m--) {
    cin >> t;
    if(t == 0) {
      cin >> j >> b;
      --j;
      power[j] = b;
      for(int i = (j / block_size) * block_size; i <= j; ++i) {
        int c = i;
        cnt[i] = 0;
        while(c < n && c / block_size == i / block_size) {
          c += power[c];
          ++cnt[i];
        }
        next[i] = (c > n) ? n + 1 : c;
      }
      //copy(ALL(next), ostream_iterator<int>(cout, " "));
      //cout << endl;
      //copy(ALL(cnt), ostream_iterator<int>(cout, " "));
      //cout << endl;
    } else {
      cin >> j;
      --j;
      int prev = j, cur = next[j], jumps = cnt[j];
      //cout << "jumps : " << prev;
      while(cur != n + 1) {
        prev = cur;
        cur = next[cur];
        //cout << ", " << cur;
        jumps += cnt[prev];
      }
      //cout << endl;
      cout << prev + 1 << " " << jumps << endl;
    }
  }
}


// Solution to : http://codeforces.com/contest/13/problem/E
#include <algorithm>
#include <fstream>
#include <iostream>
#include <vector>
#include <cmath>
#include <iterator>
#include <map>
#include <set>
#ifndef ONLINE_JUDGE
#include <prettyprint/prettyprint.hpp>
#endif

#define FOR(i, n) for(int i = 0; i < n; ++i)
#define TEST int T; std::cin >> T; while(T--)
#define ALL(v) v.begin(), v.end()

using ll = long long;
using ull = unsigned long long;
using vi = std::vector<int>;
using vll = std::vector<ll>;
using vull = std::vector<ull>;
using pii = std::pair<int, int>;
using pll = std::pair<ll, ll>;

using namespace std;

int N, M;
int num_blocks, block_size;
int power[100000];

int jumps[320][320];
int exits[320][320];

int get_block(int i) {
	return i / block_size;
}
int get_block_idx(int i) {
	return i % block_size;
}

void init() {
	block_size = ceil(sqrt(N));
	num_blocks = ceil((float)N / block_size);

	for (int i = 0; i < N; ++i) {
		int cur = i, prev, limit = min(get_block(i) * block_size + block_size - 1, N - 1);

		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

void show() {
	cout << "Jumps : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << jumps[i][j] << " ";
		}
		cout << endl;
	}
	cout << "Exits : " << endl;
	for(int i = 0; i < num_blocks; ++i) {
		for(int j = 0; j < block_size; ++j) {
			cout << exits[i][j] << " ";
		}
		cout << endl;
	}
}

void update(int x, int newval) {
	power[x] = newval;

	int start_idx = get_block(x) * block_size;
	int limit = min(start_idx + block_size - 1, N - 1);

	for (int i = start_idx; i <= limit; ++i) {
		int cur = i, prev;
		int cnt = 0;
		while(cur <= limit) {
			++cnt;
			prev = cur;
			cur += power[cur];
		}
		exits[get_block(i)][get_block_idx(i)] = (cur < N) ? (cur) : (prev);
		jumps[get_block(i)][get_block_idx(i)] = (cur < N) ? (cnt) : (cnt - 1);
	}
}

pii query(int x) {
	int total_jumps = 0, prev;

	while(x + power[x] < N) {
		total_jumps += jumps[get_block(x)][get_block_idx(x)];
		prev = x;
		x = exits[get_block(x)][get_block_idx(x)];
	}
	return make_pair(x + 1, total_jumps + 1);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#ifndef ONLINE_JUDGE
	ifstream fin("in.txt");
	ofstream fout("out.txt");
	auto cinbuf = cin.rdbuf(fin.rdbuf());    // save and redirect
	auto coutbuf = cout.rdbuf(fout.rdbuf()); // save and redirect
#endif
	cin >> N >> M;

	FOR(i, N) {
		cin >> power[i];
	}

	init();
	// show();
	vector<pair<int, int>> buffer;
	FOR(i, M) {
		int t, a, b;
		cin >> t;
		if(t == 0) {
			cin >> a >> b;
			--a;
			update(a, b);
		} else {
			cin >> a;
			--a;
			buffer.emplace_back(query(a));
		}
	}
	for(auto e : buffer) {
		cout << e.first << " " << e.second << "\n";
	}
	// cout << "Power : ";
	// copy(power, power + N, ostream_iterator<int>(cout, " "));
#ifndef ONLINE_JUDGE
	cin.rdbuf(cinbuf);    // restore
	cout.rdbuf(coutbuf); // restore
#endif
}