Little Petya likes to play a lot. Most of all he likes to play a game «Holes». This is a game for one person with following rules:

There are N holes located in a single row and numbered from left to right with numbers from 1 to N. Each hole has it's own power (hole number i has the power ai). If you throw a ball into hole i it will immediately jump to hole i + ai, then it will jump out of it and so on. If there is no hole with such number, the ball will just jump out of the row. On each of the M moves the player can perform one of two actions: 

  * Set the power of the hole a to value b. 
  * Throw a ball into the hole a and count the number of jumps of a ball before it jump out of the row and also write down the number of the hole from which it jumped out just before leaving the row. 



Petya is not good at math, so, as you have already guessed, you are to perform all computations.

Input

The first line contains two integers N and M (1 ≤ N ≤ 105, 1 ≤ M ≤ 105) — the number of holes in a row and the number of moves. The second line contains N positive integers not exceeding N — initial values of holes power. The following M lines describe moves made by Petya. Each of these line can be one of the two types: 

  * 0 a b
  * 1 a

Type 0 means that it is required to set the power of hole a to b, and type 1 means that it is required to throw a ball into the a-th hole. Numbers a and b are positive integers do not exceeding N.

Output

For each move of the type 1 output two space-separated numbers on a separate line — the number of the last hole the ball visited before leaving the row and the number of jumps it made.

Examples

Input

8 5
1 1 1 1 1 2 8 2
1 1
0 1 3
1 1
0 3 4
1 2


Output

8 7
8 5
7 3
#include <bits/stdc++.h>
using namespace std;
const double PI =
    3.141592653589793238462643383279502884197169399375105820974944;
int n, m;
int bl;
int a[100005], nex[100005], steps[100005], b[100005];
int main() {
  scanf("%d%d", &n, &m);
  bl = sqrt(n);
  for (int i = 0; i < (n); i++) scanf("%d", &a[i]), b[i] = i / bl;
  for (int i = (n - 1); i >= 0; i--) {
    int x = i + a[i];
    if (x >= n)
      nex[i] = -1, steps[i] = 1;
    else if (b[i] == b[x])
      nex[i] = nex[x], steps[i] = 1 + steps[x];
    else
      nex[i] = x, steps[i] = 1;
  }
  while (m--) {
    int type, x, y, z;
    scanf("%d", &type);
    if (type == 0) {
      scanf("%d%d", &x, &y);
      x--;
      a[x] = y;
      if (x + y >= n)
        nex[x] = -1, steps[x] = 1;
      else if (b[x] == b[x + y])
        nex[x] = nex[x + y], steps[x] = 1 + steps[x + y];
      else
        nex[x] = x + y, steps[x] = 1;
      while (x > 0 and b[x] == b[x - 1]) {
        x--;
        y = a[x];
        if (x + y >= n)
          nex[x] = -1, steps[x] = 1;
        else if (b[x] == b[x + y])
          nex[x] = nex[x + y], steps[x] = 1 + steps[x + y];
        else
          nex[x] = x + y, steps[x] = 1;
      }
    } else {
      scanf("%d", &x);
      x--;
      int ans = 0, cur = x;
      while (x != -1) {
        ans += steps[x];
        cur = x;
        x = nex[x];
      }
      while (cur < n) x = cur, cur = cur + a[cur];
      printf("%d %d\n", x + 1, ans);
    }
  }
}
