#include <bits/stdc++.h>
using namespace std;
const long long MXN = 2e5 + 10;
const long long SQR = 700;
long long n, q, now, ans, last;
long long A[MXN], Ted[MXN], Nxt[MXN], dp[MXN];
bool f;
inline void Upd(long long t) {
  long long l = t * SQR, r = min((t + 1) * SQR - 1, n);
  Nxt[r] = r, Ted[r] = 0;
  for (int i = r - 1; i >= l; i--) {
    if (i + A[i] > r)
      Nxt[i] = i, Ted[i] = 0;
    else
      Nxt[i] = Nxt[A[i] + i], Ted[i] = Ted[A[i] + i] + 1;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q;
  for (int i = 1; i <= n; i++) cin >> A[i];
  for (int t = 0; t <= n / SQR; t++) Upd(t);
  while (q--) {
    cin >> f;
    if (f) {
      cin >> now, ans = 0;
      while (now <= n) {
        if (now < Nxt[now])
          last = now, ans += Ted[now], now = Nxt[now];
        else
          last = now, ans++, now += A[now];
      }
      cout << last << ' ' << ans << '\n';
    } else {
      long long a, b;
      cin >> a >> b;
      A[a] = b;
      Upd(a / SQR);
    }
  }
  return 0;
}
