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 long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long MAXN = 100010;
const long long BSIZ = 800;
struct node {
  int prior, val, cnt = 1, w, subw, cst, subcst;
  node *l, *r, *p;
  node(int val, int cw, int cst)
      : val(val), prior(rand()), w(cw), cst(cst), subcst(0) {
    l = r = p = nullptr;
  }
};
inline int cnt(node* t) {
  if (!t) return 0;
  return t->cnt;
}
inline int subw(node* t) {
  if (!t) return 0;
  return t->subw;
}
inline int subcst(node* t) {
  if (!t) return 0;
  return t->subcst;
}
inline void upd(node*& t) {
  if (!t) return;
  t->cnt = 1 + cnt(t->l) + cnt(t->r);
  t->subw = t->w + subw(t->l) + subw(t->r);
  t->subcst = t->cst + subcst(t->l) + subcst(t->r);
}
void merge(node*& t, node*& l, node*& r) {
  if (!l)
    t = r;
  else if (!r)
    t = l;
  else if (l->prior > r->prior) {
    merge(l->r, l->r, r);
    l->r->p = l;
    t = l;
  } else {
    merge(r->l, l, r->l);
    r->l->p = r;
    t = r;
  }
  upd(t);
}
void split(node* t, node*& l, node*& r, int key) {
  if (!t) {
    l = r = nullptr;
    return;
  }
  int k = cnt(t->l);
  if (k + 1 == key) {
    r = t->r;
    if (r) r->p = nullptr;
    t->r = nullptr;
    l = t;
  } else if (k >= key) {
    t->l->p = nullptr;
    split(t->l, l, t->l, key);
    if (t->l) t->l->p = t;
    r = t;
  } else {
    t->r->p = nullptr;
    split(t->r, t->r, r, key - 1 - k);
    if (t->r) t->r->p = t;
    l = t;
  }
  upd(l);
  upd(r);
}
int count_index(node*& t, int side = 1) {
  if (!t) return 0;
  int cur = 0;
  if (side == 1) cur += cnt(t->l) + 1;
  node* A = t->p;
  if (!A) {
    return cur;
  } else if (A->l == t) {
    return cur + count_index(A, 0);
  } else {
    return cur + count_index(A, 1);
  }
}
int get_height(node*& t, int side = 1) {
  if (!t) return 0;
  int cur = 0;
  if (side == 1) cur += subw(t->l) + t->w;
  node* A = t->p;
  if (!A) {
    return cur;
  } else if (A->l == t) {
    return cur + get_height(A, 0);
  } else {
    return cur + get_height(A, 1);
  }
}
int N, Q, a, b, c;
int A[MAXN];
vector<long long> V[MAXN];
vector<long long> pred;
int B[MAXN];
int D[MAXN];
node* opens[MAXN];
node* closes[MAXN];
node* root;
void dfs(int x) {
  pred.emplace_back(x);
  for (auto v : V[x]) dfs(v);
  pred.emplace_back(x);
}
void reroot(int a, int b) {
  int leftcut = count_index(opens[a]) - 1;
  int rightcut = count_index(closes[a]);
  node *A, *B, *C;
  split(root, root, C, rightcut);
  split(root, A, B, leftcut);
  merge(root, A, C);
  int ins = count_index(opens[b]);
  split(root, A, C, ins);
  merge(root, A, B);
  merge(root, root, C);
}
void update(node*& t) {
  if (!t) return;
  upd(t);
  update(t->p);
}
int find_first(node*& t, int side = 1) {
  if (!t) {
    assert(0);
    return 0;
  }
  if (side == 2) {
    assert(subcst(t));
    if (subcst(t->r))
      return find_first(t->r, 2);
    else if (t->cst) {
      return t->val;
    } else
      return find_first(t->l, 2);
  }
  if (side == 1 && t->cst) return t->val;
  if (side == 1 && subcst(t->l)) return find_first(t->l, 2);
  node* A = t->p;
  assert(A);
  if (A->l == t) {
    return find_first(A, 0);
  } else
    return find_first(A, 1);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  root = nullptr;
  cin >> N >> Q;
  for (int i = 1; i <= N; ++i) {
    cin >> A[i];
    int t = A[i] + i;
    t = min(N + 1, t);
    D[i] = t;
    V[t].emplace_back(i);
  }
  for (int i = 1; i <= N + 1; ++i) B[i] = 1;
  dfs(N + 1);
  for (auto i : pred) {
    int cst = 0;
    if (A[i] + i > N && B[i] == 1) cst = 1;
    node* A = new node(i, B[i], cst);
    if (B[i] == 1)
      opens[i] = A;
    else
      closes[i] = A;
    B[i] = -1;
    merge(root, root, A);
  }
  while (Q--) {
    cin >> a;
    if (a == 1) {
      cin >> b;
      cout << find_first(opens[b]) << ' ' << get_height(opens[b]) - 1 << '\n';
    } else {
      cin >> b >> c;
      int nt = min(N + 1, c + b);
      if (nt == N + 1 && D[b] != N + 1) {
        opens[b]->cst = 1;
        update(opens[b]);
      } else if (nt != N + 1 && D[b] == N + 1) {
        opens[b]->cst = 0;
        update(opens[b]);
      }
      D[b] = nt;
      reroot(b, nt);
    }
  }
}
