#include <bits/stdc++.h>
using namespace std;
int n, m, a[100005], br[100005], bl[100005];
pair<int, int> to[100005];
void recalc(int num) {
  int mx = br[num];
  for (int i = br[num]; i >= bl[num]; i--) {
    if (i + a[i] > n) {
      to[i] = {0, i};
      continue;
    }
    if (i + a[i] > mx) {
      to[i] = {1, i + a[i]};
    } else {
      to[i] = {to[i + a[i]].first + 1, to[i + a[i]].second};
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  int len = 340;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    br[i / len] = i;
    if (bl[i / len] == 0) {
      bl[i / len] = i;
    }
  }
  for (int i = 0; i <= len; i++) {
    if (br[i] != 0) {
      recalc(i);
    }
  }
  for (int i = 0; i < m; i++) {
    int type;
    cin >> type;
    if (type == 0) {
      int pos, val;
      cin >> pos >> val;
      a[pos] = val;
      recalc(pos / len);
    } else {
      int pos;
      cin >> pos;
      int ans = 0;
      while (1) {
        if (to[pos].second == pos) {
          ans++;
          cout << pos << " ";
          break;
        }
        ans += to[pos].first;
        pos = to[pos].second;
      }
      cout << ans << "\n";
    }
  }
  return 0;
}
