#include <bits/stdc++.h>
using namespace std;
const int maxn = 10100;
int n, m, q;
struct node {
  int p[maxn / 10];
  int next, len;
  int sum[maxn / 10], tp[maxn / 10], jump[maxn / 10];
} h[maxn / 10];
inline int read() {
  int sum = 0, naga = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') naga = -1;
    ch = getchar();
  }
  while (ch <= '9' && ch >= '0') {
    sum = sum * 10 + ch - '0';
    ch = getchar();
  }
  return sum * naga;
}
void check(int id, int mx) {
  for (int i = mx; i >= 1; i--) {
    if (i + h[id].p[i] > h[id].len) {
      h[id].sum[i] = 1;
      int tik = id, tmp = i + h[id].p[i];
      while (tmp > h[tik].len && tik <= (n - 1) / q + 1) {
        tmp -= h[tik].len;
        tik++;
      }
      h[id].tp[i] = tmp;
      h[id].jump[i] = tik - id;
    } else {
      h[id].sum[i] = 1 + h[id].sum[h[id].p[i] + i];
      h[id].tp[i] = h[id].tp[h[id].p[i] + i];
      h[id].jump[i] = h[id].jump[h[id].p[i] + i];
    }
  }
}
int main() {
  n = read();
  m = read();
  int a, b, c;
  q = sqrt(n);
  for (int i = 1; i <= n; i++) {
    a = read();
    int tik = (i - 1) / q + 1;
    h[tik].len++;
    h[tik].p[h[tik].len] = a;
  }
  for (int i = 1; i <= (n - 1) / q + 1; i++) h[i].next = i + 1;
  for (int i = (n - 1) / q + 1; i >= 1; i--) check(i, h[i].len);
  for (int i = 1; i <= m; i++) {
    a = read();
    b = read();
    int k = (b - 1) / q + 1;
    b = (b - 1) % q + 1;
    if (a == 1) {
      int tik = 0;
      while (k <= (n - 1) / q + 1) {
        tik += h[k].sum[b];
        if (k + h[k].jump[b] > (n - 1) / q + 1) {
          int ans = b + (k - 1) * q;
          int bb = b;
          while (h[k].p[bb] + bb <= h[k].len) {
            ans += h[k].p[bb];
            bb = h[k].p[bb] + bb;
          }
          printf("%d ", ans);
          break;
        }
        int bv = b;
        b = h[k].tp[b];
        k += h[k].jump[bv];
      }
      printf("%d\n", tik);
    } else {
      c = read();
      h[k].p[b] = c;
      check(k, b);
    }
  }
  return 0;
}
