#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 20, SQ = 333;
int n, q, a[N], t[N], last[N];
inline void calc(int l, int r) {
  for (int i = r - 1; i >= l; i--) {
    if (i + a[i] >= r) {
      last[i] = i;
      t[i] = 0;
    } else {
      last[i] = last[i + a[i]];
      t[i] = t[i + a[i]] + 1;
    }
  }
}
inline void modify(int p, int val) {
  a[p] = val;
  calc(p / SQ * SQ, min(n, p / SQ * SQ + SQ));
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) scanf("%d", a + i);
  for (int i = 0; i < (n + SQ - 1) / SQ; i++)
    calc(i * SQ, min(n, (i + 1) * SQ));
  while (q--) {
    int type;
    scanf("%d", &type);
    if (!type) {
      int x, y;
      scanf("%d %d", &x, &y);
      x--;
      modify(x, y);
    } else {
      int x;
      scanf("%d", &x);
      x--;
      int ans = 0;
      while (x + a[x] < n) {
        x += a[x];
        ans++;
        ans += t[x];
        x = last[x];
      }
      ans++;
      printf("%d %d\n", x + 1, ans);
    }
  }
}
