#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
int a[maxn], ne[maxn], j[maxn];
int n, m, k;
void Up(int x) {
  if (x + a[x] >= n or (((x + a[x]) / k) != (x / k))) {
    ne[x] = x;
    j[x] = 1;
  } else {
    ne[x] = ne[x + a[x]];
    j[x] = j[x + a[x]] + 1;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  k = int(sqrt(n));
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = n - 1; i >= 0; i--) Up(i);
  for (int i = 0; i < m; i++) {
    int tmp;
    scanf("%d", &tmp);
    if (tmp == 0) {
      int tmp1, tmp2;
      scanf("%d%d", &tmp1, &tmp2);
      tmp1--;
      a[tmp1] = tmp2;
      for (int i = tmp1; i and (i / k) == (tmp1 / k); i--) Up(i);
      if ((tmp1 / k) == 0) Up(0);
    } else {
      int p;
      scanf("%d", &p);
      p--;
      int tj = 0, ans = 0;
      while (p < n) {
        tj += j[p];
        ans = ne[p];
        p = ans + a[ans];
      }
      printf("%d %d\n", ans + 1, tj);
    }
  }
}
