Problem: Yuezheng Ling gives Luo Tianyi a tree which has n nodes, rooted at 1. 

Luo Tianyi will tell you that the parent of the i-th node is a_i (1 ≤ a_i<i for 2 ≤ i ≤ n), and she will ask you to perform q queries of 2 types:

  1. She'll give you three integers l, r and x (2 ≤ l ≤ r ≤ n, 1 ≤ x ≤ 10^5). You need to replace a_i with max(a_i-x,1) for all i with l ≤ i ≤ r.
  2. She'll give you two integers u, v (1 ≤ u, v ≤ n). You need to find the [LCA](https://en.wikipedia.org/wiki/Lowest_common_ancestor) of nodes u and v (their lowest common ancestor).

Input

The first line contains two integers n and q (2≤ n,q ≤ 10^5) — the number of nodes and the number of queries, respectively.

The second line contains n-1 integers a_2, a_3,..., a_n (1 ≤ a_i < i), where a_i is the parent of the node i.

Next q lines contain queries. For each query, the first integer of each line is t (t = 1 or 2) — the type of the query. 

If t = 1, this represents the query of the first type. Then, three integers will follow: l, r, x (2 ≤ l ≤ r ≤ n, 1 ≤ x ≤ 10^5), meaning that you have to replace a_i with max(a_i-x,1) for all i with l ≤ i ≤ r.

If t = 2, this represents the query of the second type. Then, two integers will follow: u and v (1 ≤ u, v ≤ n), and you have to find the LCA of u and v. 

It's guaranteed that there is at least one query of the second type.

Output

For each query of the second type output answer on a new line.

Example

Input


6 4
1 2 3 3 4
2 3 4
1 2 3 1
2 5 6
2 2 3


Output


3
3
1

Note

The tree in example is shown below.

<image>

After the query of the first type, the tree changes and is looking as shown below.

<image>

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define pii pair<int,int>
#define fi first
#define se second
#define PB push_back
#define ll long long
#define ull unsigned long long
#define pll pair<ll,ll> 
#define y1 orzkcz
using namespace std;

const int B=256;
const int N=100005;
int n,Q,a[N],jmp[N];
int tg[N],be[N],rem[N];
int L[N],R[N];
void build(int k){
	For(i,L[k],R[k]) jmp[i]=(a[i]<L[k]?i:jmp[a[i]]);
}
void pushdown(int k){
	For(i,L[k],R[k]) a[i]=max(0,a[i]-tg[k]);
	tg[k]=0;
}
void chg(int l,int r){
	int v;
	scanf("%d",&v);
	int bl=be[l],br=be[r];
	if (bl==br){
		pushdown(bl);
		For(i,l,r) a[i]=max(0,a[i]-v);
		build(bl);
	}
	else{
		pushdown(bl);
		pushdown(br);
		For(i,l,R[bl]) a[i]=max(0,a[i]-v);
		For(i,L[br],r) a[i]=max(0,a[i]-v);
		build(bl);
		build(br);
		
		For(i,bl+1,br-1){
			tg[i]=min(tg[i]+v,n+5);
			if ((rem[i]-=v)>0){
				pushdown(i);
				build(i);
			} 
			else rem[i]=0;
		}
	}
}
int qry(int x,int y){
	for (;x!=y;){
		if (x<y) swap(x,y);
		//cout<<"finder "<<x<<' '<<y<<endl;
		if (y<=0) return 1;
		if (rem[be[x]]){
			if (jmp[x]==jmp[y]){
				for (;x!=y;){
					if (x<y) swap(x,y);
					x=max(a[x]-tg[be[x]],0);
				}
				return max(x,1);
			}
			x=jmp[x];
			x=a[x]-tg[be[x]];
		}
		
		else x=a[x]-tg[be[x]];
	}
	return max(x,1);
}
int main(){
	scanf("%d%d",&n,&Q);
	For(i,2,n) scanf("%d",&a[i]);
	For(i,1,n) be[i]=(i-1)/B+1;
	For(i,1,be[n]){
		L[i]=(i-1)*B+1;
		R[i]=min(i*B,n);
		rem[i]=B;
		build(i);
	}
	while (Q--){
		int tp,l,r;
		scanf("%d%d%d",&tp,&l,&r);
		if (tp==1) chg(l,r);
		else printf("%d\n",qry(l,r));
	}
}