#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const long long ooo = 9223372036854775807ll;
const int _cnt = 1000 * 1000 + 7;
const int _p = 1000 * 1000 * 1000 + 7;
const int N = 100005;
const double PI = acos(-1.0);
const double eps = 1e-9;
int o(int x) { return x % _p; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
void file_put() {
  string s = "/home/jslijin/jslijin/code/";
  freopen((s + "code.in").c_str(), "r", stdin);
  freopen((s + "code.out").c_str(), "w", stdout);
}
int n, q, last[N], a[N], cnt[N], ans = 0, op, x, y, B;
inline void get(int x) {
  if (x + a[x] >= n || x / B != (x + a[x]) / B)
    cnt[x] = 1, last[x] = x;
  else
    cnt[x] = cnt[x + a[x]] + 1, last[x] = last[x + a[x]];
}
int main() {
  scanf("%d%d", &n, &q), B = sqrt(n) + 0.5;
  for (int i = (0); i <= (n - 1); ++i) scanf("%d", &a[i]);
  for (int i = (n - 1); i >= (0); --i) get(i);
  while (q--) {
    scanf("%d%d", &op, &x), --x;
    if (op) {
      ans = 0;
      int ret = x;
      for (; x < n; ret = last[x], x = ret + a[last[x]]) ans += cnt[x];
      printf("%d %d\n", ++ret, ans);
    } else {
      scanf("%d", &y), a[x] = y;
      for (int i = (x); i >= (x / B * B); --i) get(i);
    }
  }
  return 0;
}
