#include <bits/stdc++.h>
using namespace std;
template <class T>
void read(T& x) {
  T res = 0, f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    res = (res << 3) + (res << 1) + c - '0';
    c = getchar();
  }
  x = res * f;
}
const long long N = 300000 + 10;
const int mod = 1e9 + 7;
int w[N], n, m, block, l[N], r[N], la[N];
int val[N], nxt[N];
void change(int L, int R) {
  for (int i = R; i >= L; i--) {
    if (i + w[i] > r[i]) {
      val[i] = 1;
      la[i] = i;
      nxt[i] = i + w[i];
    } else
      val[i] = val[i + w[i]] + 1, nxt[i] = nxt[i + w[i]], la[i] = la[i + w[i]];
  }
}
void query(int x) {
  int ans = 0, pre = la[x];
  while (x <= n) {
    ans += val[x];
    pre = la[x];
    x = nxt[x];
  }
  printf("%d %d\n", pre, ans);
}
int main() {
  read(n);
  read(m);
  for (int i = 1; i <= n; i++) read(w[i]);
  block = sqrt(n) + 1;
  for (int i = 1; i <= n; i++) {
    int num = (i - 1) / block + 1;
    l[i] = (num - 1) * block + 1;
    r[i] = min(n, num * block);
  }
  change(1, n);
  for (int i = 1; i <= m; i++) {
    int ty, x;
    read(ty), read(x);
    if (ty == 1) {
      query(x);
    } else {
      int y;
      read(y);
      w[x] = y;
      change(l[x], r[x]);
    }
  }
  return 0;
}
