#include <bits/stdc++.h>
using namespace std;
int n, m, a[100007], nxt[100007], cnt[100007];
void relax(int i) {
  if (i + a[i] > n || (i + a[i]) / 400 != i / 400) {
    nxt[i] = i + a[i];
    cnt[i] = 1;
  } else {
    nxt[i] = nxt[i + a[i]];
    cnt[i] = cnt[i + a[i]] + 1;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = n; i >= 1; --i) relax(i);
  for (int i = 1; i <= m; ++i) {
    int op, b, c;
    cin >> op >> b;
    if (op == 0) {
      cin >> c;
      a[b] = c;
      for (int i = b; i >= b / 400 * 400; --i) relax(i);
    } else {
      long long res = 0, lst = b;
      while (b <= n) {
        lst = b;
        res += cnt[b];
        b = nxt[b];
      }
      while (lst + a[lst] <= n) lst = lst + a[lst];
      cout << lst << ' ' << res << endl;
    }
  }
}
