#include <bits/stdc++.h>
inline char gc() {
  static char now[1 << 16], *S, *T;
  if (S == T) {
    T = (S = now) + fread(now, 1, 1 << 16, stdin);
    if (S == T) return EOF;
  }
  return *S++;
}
inline int read() {
  int x = 0, f = 1;
  char ch = gc();
  while (ch < '0' || '9' < ch) {
    if (ch == '-') f = -1;
    ch = gc();
  }
  while ('0' <= ch && ch <= '9') x = x * 10 + ch - '0', ch = gc();
  return x * f;
}
int const N = 1e5 + 10;
int n, m, n0;
int p[N], nxt[N], c[N];
void update(int t) {
  int fr = t * n0, to = fr + n0 - 1;
  if (to > n) to = n;
  for (int i = to; i >= fr; i--)
    if (i + p[i] > to)
      nxt[i] = i + p[i], c[i] = 1;
    else
      nxt[i] = nxt[i + p[i]], c[i] = 1 + c[i + p[i]];
}
int main() {
  n = read(), m = read();
  n0 = sqrt(n);
  for (int i = 1; i <= n; i++) p[i] = read(), nxt[i] = i, c[i] = 0;
  for (int t = 0; t <= n / n0; t++) update(t);
  for (int i = 1; i <= m; i++) {
    int opt = read();
    if (opt == 0) {
      int x = read(), y = read();
      p[x] = y;
      update(x / n0);
    } else {
      int res = 0, pre;
      for (int x = read(); x <= n; x = nxt[x]) pre = x, res += c[x];
      while (pre + p[pre] <= n) pre += p[pre];
      printf("%d %d\n", pre, res);
    }
  }
  return 0;
}
