#include <bits/stdc++.h>
int N, Q;
int Size, Num;
int K[200010];
int Block[200010], Left[510], Right[510];
int Cnt[200010], Next[200010], End[200010];
void Expand(int X) {
  int Y = X + K[X];
  if (Block[X] == Block[Y]) {
    Cnt[X] = Cnt[Y] + 1;
    Next[X] = Next[Y];
    End[X] = End[Y];
  }
  if (Y > N || Block[X] != Block[Y]) {
    Cnt[X] = 1;
    Next[X] = Y;
    End[X] = X;
  }
}
void Modify(int X, int Y) {
  K[X] = Y;
  for (int i = X; Block[i] == Block[X] && i; --i) Expand(i);
}
void Calc(int X) {
  int Sum = 0;
  int Pos = X;
  int EndB;
  for (; Pos <= N; Pos = Next[Pos]) EndB = End[Pos], Sum += Cnt[Pos];
  printf("%d %d\n", EndB, Sum);
}
int main() {
  scanf("%d%d", &N, &Q);
  Size = (int)sqrt(N);
  if (N % Size)
    Num = N / Size + 1;
  else
    Num = N / Size;
  for (int i = 1; i <= N; ++i) {
    scanf("%d", &K[i]);
    Block[i] = (i - 1) / Size + 1;
  }
  for (int i = 1; i <= Num; ++i) {
    Left[i] = Right[i - 1] + 1;
    Right[i] = i * Size;
  }
  for (int i = N; i; --i) Expand(i);
  for (int i = 1; i <= Q; ++i) {
    int O;
    scanf("%d", &O);
    if (O == 1) {
      int X;
      scanf("%d", &X);
      Calc(X);
    }
    if (O == 0) {
      int X, Y;
      scanf("%d%d", &X, &Y);
      Modify(X, Y);
    }
  }
}
