#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];
void update(int i) {
  if (i + a[i] > n || i / B != (i + a[i]) / B) {
    h[i] = i, c[i] = 0;
  } else {
    h[i] = h[i + a[i]];
    c[i] = c[i + a[i]] + 1;
  }
}
int main() {
  n = rd(), m = rd();
  for (int i = 1; i <= n; i++) a[i] = rd();
  for (int i = n; i >= 1; i--) update(i);
  while (m--) {
    int op = rd();
    if (op == 0) {
      int x = rd(), y = rd();
      a[x] = y;
      for (int i = x; i > 0 && i / B == x / B; i--) {
        update(i);
      }
    } else if (op == 1) {
      int x = rd();
      int last = 1, count = 0;
      for (; x <= n; last = h[x], x = last + a[last]) {
        count += c[x] + 1;
      }
      printf("%d %d\n", last, count);
    }
  }
}
