#include <bits/stdc++.h>
using namespace std;
int sq;
struct node {
  int nxt = 0, stps = 0, val = 0, B;
};
int getblock(int i) { return i / sq; }
int main() {
  int n, m, c = 0, block = 1;
  scanf("%d %d", &n, &m);
  vector<node> v(n);
  sq = sqrt(n);
  int k = n / sq;
  k *= sq;
  k--;
  for (int i = 0; i < n; i++) {
    scanf("%d", &v[i].val);
    c++;
    if (c > sq) {
      block++;
      c = 1;
    }
    if (i > k)
      v[i].B = block - 1;
    else
      v[i].B = block;
  }
  for (int i = 0; i < n; i++) {
    int b = v[i].B;
    int tmp = i, tmp2;
    tmp2 = tmp;
    int steps = 0;
    while (tmp < n && v[tmp].B == b) {
      steps++;
      tmp2 = tmp;
      tmp += v[tmp].val;
    }
    v[i].stps = steps;
    if (tmp < n) {
      v[i].nxt = tmp;
    } else {
      v[i].nxt = tmp2;
    }
  }
  while (m--) {
    int a, tmp, tmp2, ans = 0;
    scanf("%d", &a);
    if (a) {
      scanf("%d", &tmp);
      tmp--;
      tmp2 = tmp;
      a = tmp;
      int f = 0;
      while (tmp < n) {
        if (v[tmp].B == v[v[tmp].nxt].B) {
          ans += v[tmp].stps;
          while (tmp < n) {
            tmp2 = tmp;
            tmp += v[tmp].val;
          }
          break;
        }
        if (tmp == v[tmp].nxt) f = 1;
        ans += v[tmp].stps;
        tmp2 = tmp;
        tmp = v[tmp].nxt;
      }
      cout << tmp2 + 1 << " " << ans << "\n";
    } else {
      int b, steps = 0;
      scanf("%d %d", &a, &b);
      a--;
      tmp = a;
      v[a].val = b;
      int B = v[a].B;
      while (tmp < n && v[tmp].B == B) {
        steps++;
        tmp2 = tmp;
        tmp += v[tmp].val;
      }
      v[a].stps = steps;
      if (tmp < n)
        v[a].nxt = tmp;
      else
        v[a].nxt = tmp2;
      while (a >= 0 && a < n && v[a].B == B) {
        tmp = a;
        steps = 0;
        int nxt = tmp + v[tmp].val;
        if (nxt < n && v[nxt].B == v[tmp].B) {
          v[a].stps = v[nxt].stps + 1;
          v[a].nxt = v[nxt].nxt;
        } else if (nxt < n && v[nxt].B != v[tmp].B) {
          v[a].stps = 1;
          v[a].nxt = nxt;
        } else {
          v[a].stps = 1;
          v[a].nxt = a;
        }
        a--;
      }
    }
  }
}
