// ~~ icebear love attttt ~~
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;

template<class T>
    bool minimize(T &a, const T &b) {
        if (a > b) return a = b, true;
        return false;
    }

template<class T>
    bool maximize(T &a, const T &b) {
        if (a < b) return a = b, true;
        return false;
    }

#define FOR(i,a,b) for(int i=(a); i<=(b); ++i)
#define FORR(i,a,b) for(int i=(a); i>=(b); --i)
#define REP(i, n) for(int i=0; i<(n); ++i)
#define RED(i, n) for(int i=(n)-1; i>=0; --i)
#define MASK(i) (1LL << (i))
#define BIT(S, i) (((S) >> (i)) & 1)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define task "icebearat"

const int MOD = 1e9 + 7;
const int inf = 1e9 + 27092008;
const ll INF = 1e18 + 27092008;
const int N = 1e5 + 5;
const int BLOCK_SIZE = 369;
int n, q, t[N];
int f[N], nxt[N];
int L[N], R[N], B[N];

// f[block][i] : minimum operation to jump from i to block + 1
// nxt[block][i] : position after jump from i to next block

void update(int i) {
    if (R[B[i]] == n - 1) {
        if (i + t[i] >= n) {
            f[i] = 1;
            nxt[i] = i;
        } else {
            f[i] = f[i + t[i]] + 1;
            nxt[i] = nxt[i + t[i]];
        }
        return;
    }

    if (i + t[i] > R[B[i]]) {
        f[i] = 1;
        nxt[i] = i + t[i];
    } else {
        f[i] = f[i + t[i]] + 1;
        nxt[i] = nxt[i + t[i]];
    }
}

void init(void) {
    cin >> n >> q;
    REP(i, n) cin >> t[i];
    REP(i, BLOCK_SIZE) {
        L[i] = i * BLOCK_SIZE;
        R[i] = min(n, (i + 1) * BLOCK_SIZE) - 1;
    }
    REP(i, n) B[i] = i / BLOCK_SIZE;
    RED(i, n) update(i);
}

void process(void) {
    int type, pos, value;
    while(q--) {
        cin >> type;
        if (type == 0) {
            cin >> pos >> value;
            pos--;
            t[pos] = value;
            FORR(i, pos, L[B[pos]]) update(i);
        } else {
            cin >> pos;
            pos--;
            int ans = 0, block = B[pos];
            while(R[block] < n - 1) {
                ans += f[pos];
                pos = nxt[pos];
                pos++;
            }
            ans += f[pos];
            pos = nxt[pos];
            cout << pos + 1 << ' ' << ans << '\n';
        }
    }
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    if (fopen(task".inp", "r")) {
        freopen(task".inp", "r", stdin);
        freopen(task".out", "w", stdout);
    }
    int tc = 1;
//    cin >> tc;
    while(tc--) {
        init();
        process();
    }
    return 0;
}
