#include <bits/stdc++.h>
using namespace std;
const int B = 320, MAXN = 1e5 + 5;
inline int blo(int x) { return (x - 1) / B + 1; }
inline int stat(int b) { return (b - 1) * B + 1; }
inline int ennd(int b) { return b * B; }
int n, m, a[MAXN], t[MAXN], N_E_X_T_bababab[MAXN], la[MAXN];
void update(int b) {
  for (int i = min(n, ennd(b)); i >= stat(b); i--) {
    if (i + a[i] > min(n, ennd(b))) {
      t[i] = 1;
      la[i] = i;
      N_E_X_T_bababab[i] = i + a[i];
    } else {
      t[i] = t[i + a[i]] + 1;
      la[i] = la[i + a[i]];
      N_E_X_T_bababab[i] = N_E_X_T_bababab[i + a[i]];
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= blo(n); i++) update(i);
  while (m--) {
    int op, x, y;
    cin >> op;
    if (op == 0) {
      cin >> x >> y;
      a[x] = y;
      update(blo(x));
    } else {
      cin >> x;
      int tim = 0, laspos = x;
      while (x <= n) {
        tim += t[x];
        laspos = la[x];
        x = N_E_X_T_bababab[x];
      }
      cout << laspos << " " << tim << endl;
    }
  }
  return 0;
}
