#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int BSZ = 610;
int n, m;
int a[N];
int step[N], finish[N];
int divs[N];
bool change[N / BSZ];
void update(int idx) {
  int l = idx * BSZ;
  int r = min(l + BSZ - 1, n - 1);
  for (int i = r; i >= l; --i) {
    if (i + a[i] > r)
      finish[i] = i, step[i] = 1;
    else
      finish[i] = finish[i + a[i]], step[i] = step[i + a[i]] + 1;
  }
  change[idx] = false;
}
void build() {
  for (int i = 0; i * BSZ < n; ++i) update(i);
}
void update(int idx, int val) {
  a[idx] = val;
  change[idx / BSZ] = true;
}
void query(int pos) {
  int ret = 0, last = pos;
  while (pos < n) {
    if (change[divs[pos]]) update(divs[pos]);
    ret += step[pos];
    last = finish[pos], pos = finish[pos] + a[finish[pos]];
  }
  printf("%d %d\n", last + 1, ret);
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    divs[i] = i / BSZ;
  }
  build();
  while (m-- > 0) {
    int q;
    scanf("%d", &q);
    if (q == 0) {
      int a, b;
      scanf("%d %d", &a, &b);
      update(a - 1, b);
    } else {
      int a;
      scanf("%d", &a);
      query(a - 1);
    }
  }
  return 0;
}
