#include <bits/stdc++.h>
using namespace std;
struct pot {
  int to, k, conti, sum;
} p[100005];
int size, cnt = 1, n, ac, ans;
void change(int ct) {
  for (int j = min(ct * size, n); j > (ct - 1) * size; j--) {
    if (j + p[j].k > ct * size || j + p[j].k > n)
      p[j].sum = 1, p[j].to = j + p[j].k;
    else {
      p[j].to = p[j + p[j].k].to;
      p[j].sum = p[j + p[j].k].sum + 1;
    }
  }
}
void query(int y) {
  ans = 0;
  while (y <= n) {
    ans += p[y].sum;
    if (p[y].to > n) ac = y;
    y = p[y].to;
  }
  while (ac + p[ac].k <= n) {
    ac += p[ac].k;
  }
}
int main() {
  int temp = 0, m;
  scanf("%d%d", &n, &m);
  size = sqrt(n);
  for (int i = 1; i <= n; i++) {
    temp++;
    if (temp > size) {
      cnt++;
      temp = 1;
    }
    scanf("%d", &p[i].k);
    p[i].conti = cnt;
  }
  for (int i = cnt; i >= 1; i--) change(i);
  for (int i = 1; i <= m; i++) {
    int x, y, z;
    scanf("%d%d", &x, &y);
    if (x == 0) {
      scanf("%d", &z);
      p[y].k = z;
      change(p[y].conti);
    } else {
      query(y);
      printf("%d %d\n", ac, ans);
    }
  }
  return 0;
}
