#include <bits/stdc++.h>
using namespace std;
const int M = 4e5 + 5;
int n, m, k[M], fa[M], val[M], sum[M], hep[M], lazy[M], maxn[M], ch[M][2];
int read() {
  int x = 0, y = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') y = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * y;
}
int get(int u) { return (ch[fa[u]][0] == u || ch[fa[u]][1] == u); }
void filp(int u) {
  lazy[u] ^= 1;
  (ch[u][0] ^= ch[u][1] ^= ch[u][0] ^= ch[u][1]);
}
void pushup(int u) {
  sum[u] = sum[ch[u][0]] + sum[ch[u][1]] + 1;
  maxn[u] = (val[u] > (maxn[ch[u][0]] > maxn[ch[u][1]] ? maxn[ch[u][0]]
                                                       : maxn[ch[u][1]])
                 ? val[u]
                 : (maxn[ch[u][0]] > maxn[ch[u][1]] ? maxn[ch[u][0]]
                                                    : maxn[ch[u][1]]));
}
void pushdown(int u) {
  if (lazy[u]) {
    lazy[u] = 0;
    if (ch[u][0]) filp(ch[u][0]);
    if (ch[u][1]) filp(ch[u][1]);
  }
}
void rotate(int u) {
  int a = fa[u], b = fa[a], d1 = (ch[a][1] == u), d2 = (ch[b][1] == a);
  int v = ch[u][d1 ^ 1];
  if (get(a)) ch[b][d2] = u;
  ch[u][d1 ^ 1] = a, ch[a][d1] = v;
  if (v) fa[v] = a;
  fa[a] = u, fa[u] = b;
  pushup(a), pushup(u);
}
void Splay(int u) {
  int v = u, top = 0;
  hep[++top] = v;
  while (get(v)) hep[++top] = v = fa[v];
  while (top) pushdown(hep[top--]);
  while (get(u)) {
    v = fa[u], top = fa[v];
    if (get(v)) rotate((ch[v][0] == u) ^ (ch[top][0] == v) ? u : v);
    rotate(u);
  }
  pushup(u);
}
void Access(int u) {
  for (int v = 0; u; u = fa[v = u]) {
    Splay(u);
    ch[u][1] = v;
    pushup(u);
  }
}
void Reverse(int u) {
  Access(u);
  Splay(u);
  filp(u);
}
void Split(int x, int y) {
  Reverse(x);
  Access(y);
  Splay(y);
}
int Findroot(int u) {
  Access(u);
  Splay(u);
  while (ch[u][0]) {
    pushdown(u);
    u = ch[u][0];
  }
  return u;
}
void Link(int x, int y) {
  Reverse(x);
  if (Findroot(y) != x) fa[x] = y;
}
void Cut(int x, int y) {
  Split(x, y);
  if (Findroot(y) == x && fa[x] == y && !ch[x][1])
    fa[x] = ch[y][0] = 0, pushup(y);
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++) {
    k[i] = read();
    Link(i, (i + k[i] < n + 1 ? i + k[i] : n + 1));
    val[i] = i;
  }
  while (m--) {
    int opt = read(), x = read();
    if (opt == 1) {
      Split(x, n + 1);
      printf("%d %d\n", maxn[n + 1], sum[n + 1] - 1);
    }
    if (opt == 0) {
      Cut(x, (x + k[x] < n + 1 ? x + k[x] : n + 1));
      k[x] = read();
      Link(x, (x + k[x] < n + 1 ? x + k[x] : n + 1));
    }
  }
}
