#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const int B = 750;
inline char gc() {
  static char buf[1 << 16];
  static size_t pos, len;
  if (pos >= len) pos = 0, len = fread(buf, 1, sizeof(buf), stdin);
  return buf[pos++];
}
inline int rd() {
  int a, c;
  while ((a = gc()) < 40)
    ;
  if (a == '-') return -rd();
  while ((c = gc()) > 47) a = a * 10 + c - 480;
  return a - 48;
}
inline long long rdll() {
  long long a, c;
  while ((a = gc()) < 40)
    ;
  if (a == '-') return -rdll();
  while ((c = gc()) > 47) a = a * 10 + c - 480;
  return a - 48;
}
int n, m;
int a[N];
int h[N];
int c[N];
int d[N];
int main() {
  n = rd(), m = rd();
  for (int i = 1; i <= n; i++) a[i] = rd();
  auto update_block = [](int block) {
    int L = block * B, R = min(n + 1, (block + 1) * B);
    for (int i = R - 1; i >= L; i--) {
      h[i] = i, c[i] = 0;
      if (h[i] + a[i] < R) {
        h[i] = h[i] + a[i];
        c[i] = c[h[i]] + 1;
        h[i] = h[h[i]];
      }
    }
  };
  for (int i = 1; i <= n; i++) {
    d[i] = i / B;
  }
  update_block(d[n]);
  for (int i = n; i >= 1; i--) {
    if (d[i + 1] != d[i]) update_block(d[i]);
  }
  while (m--) {
    int op = rd();
    if (op == 0) {
      int x = rd(), y = rd();
      a[x] = y;
      update_block(d[x]);
    } else if (op == 1) {
      int x = rd(), ans = 1;
      do {
        ans += c[x];
        x = h[x];
        if (x + a[x] <= n) {
          x = x + a[x];
          ans++;
        }
      } while (x + a[x] <= n);
      printf("%d %d\n", x, ans);
    }
  }
}
