// ~~ 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;
}
Ly8gfn4gaWNlYmVhciBsb3ZlIGF0dHR0dCB+fgojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKdHlwZWRlZiBsb25nIGxvbmcgbGw7CnR5cGVkZWYgcGFpcjxpbnQsIGludD4gaWk7CnR5cGVkZWYgcGFpcjxpbnQsIGlpPiBpaWk7Cgp0ZW1wbGF0ZTxjbGFzcyBUPgogICAgYm9vbCBtaW5pbWl6ZShUICZhLCBjb25zdCBUICZiKSB7CiAgICAgICAgaWYgKGEgPiBiKSByZXR1cm4gYSA9IGIsIHRydWU7CiAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgfQoKdGVtcGxhdGU8Y2xhc3MgVD4KICAgIGJvb2wgbWF4aW1pemUoVCAmYSwgY29uc3QgVCAmYikgewogICAgICAgIGlmIChhIDwgYikgcmV0dXJuIGEgPSBiLCB0cnVlOwogICAgICAgIHJldHVybiBmYWxzZTsKICAgIH0KCiNkZWZpbmUgRk9SKGksYSxiKSBmb3IoaW50IGk9KGEpOyBpPD0oYik7ICsraSkKI2RlZmluZSBGT1JSKGksYSxiKSBmb3IoaW50IGk9KGEpOyBpPj0oYik7IC0taSkKI2RlZmluZSBSRVAoaSwgbikgZm9yKGludCBpPTA7IGk8KG4pOyArK2kpCiNkZWZpbmUgUkVEKGksIG4pIGZvcihpbnQgaT0obiktMTsgaT49MDsgLS1pKQojZGVmaW5lIE1BU0soaSkgKDFMTCA8PCAoaSkpCiNkZWZpbmUgQklUKFMsIGkpICgoKFMpID4+IChpKSkgJiAxKQojZGVmaW5lIG1wIG1ha2V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gIH0KfQoKdm9pZCBpbml0KHZvaWQpIHsKICAgIGNpbiA+PiBuID4+IHE7CiAgICBSRVAoaSwgbikgY2luID4+IHRbaV07CiAgICBSRVAoaSwgQkxPQ0tfU0laRSkgewogICAgICAgIExbaV0gPSBpICogQkxPQ0tfU0laRTsKICAgICAgICBSW2ldID0gbWluKG4sIChpICsgMSkgKiBCTE9DS19TSVpFKSAtIDE7CiAgICB9CiAgICBSRVAoaSwgbikgQltpXSA9IGkgLyBCTE9DS19TSVpFOwogICAgUkVEKGksIG4pIHVwZGF0ZShpKTsKfQoKdm9pZCBwcm9jZXNzKHZvaWQpIHsKICAgIGludCB0eXBlLCBwb3MsIHZhbHVlOwogICAgd2hpbGUocS0tKSB7CiAgICAgICAgY2luID4+IHR5cGU7CiAgICAgICAgaWYgKHR5cGUgPT0gMCkgewogICAgICAgICAgICBjaW4gPj4gcG9zID4+IHZhbHVlOwogICAgICAgICAgICBwb3MtLTsKICAgICAgICAgICAgdFtwb3NdID0gdmFsdWU7CiAgICAgICAgICAgIEZPUlIoaSwgcG9zLCBMW0JbcG9zXV0pIHVwZGF0ZShpKTsKICAgICAgICB9IGVsc2UgewogICAgICAgICAgICBjaW4gPj4gcG9zOwogICAgICAgICAgICBwb3MtLTsKICAgICAgICAgICAgaW50IGFucyA9IDAsIGJsb2NrID0gQltwb3NdOwogICAgICAgICAgICB3aGlsZShSW2Jsb2NrXSA8IG4gLSAxKSB7CiAgICAgICAgICAgICAgICBhbnMgKz0gZltwb3NdOwogICAgICAgICAgICAgICAgcG9zID0gbnh0W3Bvc107CiAgICAgICAgICAgICAgICBwb3MrKzsKICAgICAgICAgICAgfQogICAgICAgICAgICBhbnMgKz0gZltwb3NdOwogICAgICAgICAgICBwb3MgPSBueHRbcG9zXTsKICAgICAgICAgICAgY291dCA8PCBwb3MgKyAxIDw8ICcgJyA8PCBhbnMgPDwgJ1xuJzsKICAgICAgICB9CiAgICB9Cn0KCmludCBtYWluKCkgewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbygwKTsKICAgIGNpbi50aWUoMCk7IGNvdXQudGllKDApOwogICAgaWYgKGZvcGVuKHRhc2siLmlucCIsICJyIikpIHsKICAgICAgICBmcmVvcGVuKHRhc2siLmlucCIsICJyIiwgc3RkaW4pOwogICAgICAgIGZyZW9wZW4odGFzayIub3V0IiwgInciLCBzdGRvdXQpOwogICAgfQogICAgaW50IHRjID0gMTsKLy8gICAgY2luID4+IHRjOwogICAgd2hpbGUodGMtLSkgewogICAgICAgIGluaXQoKTsKICAgICAgICBwcm9jZXNzKCk7CiAgICB9CiAgICByZXR1cm4gMDsKfQo=