#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int Bsize, n, a[N];
pair<int, int> b[N];
int getleft(int first) { return Bsize * (first / Bsize); }
int getright(int first) { return min(n - 1, getleft(first) + Bsize - 1); }
void upd(int p, int v) {
  a[p] = v;
  int l = getleft(p);
  int r = getright(p);
  for (int i = p; i >= l; i--) {
    int first = i + a[i];
    if (first > r) {
      b[i].first = 1;
      b[i].second = first;
    } else {
      b[i].first = b[first].first + 1;
      b[i].second = b[first].second;
    }
  }
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int m = 0;
  cin >> n >> m;
  Bsize = sqrt(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = n - 1; i >= 0; i--) {
    upd(i, a[i]);
  }
  for (int i = 0; i < m; i++) {
    int t, a;
    cin >> t >> a;
    a--;
    if (t == 0) {
      int b;
      cin >> b;
      upd(a, b);
    } else {
      int res = 0, last = 0;
      while (a < n) {
        res += b[a].first;
        last = a;
        a = b[a].second;
      }
      a = last;
      while (a < n) {
        last = a;
        a = a + ::a[a];
      }
      cout << last + 1 << " " << res << "\n";
    }
  }
}
