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>
using namespace std;
const int BBB=500;
int n,m,a[100100],BLK[100100],go[100100],len[100100],dep[100100],lp[510],tag[510],num;
bool fin[510];
void rebuild(int id,int L,int R,int x){
	if(L<=lp[id]&&R>=lp[id+1]-1&&fin[id]){tag[id]+=x,tag[id]=min(tag[id],n);return;}
	fin[id]=true;
	for(int i=lp[id];i<lp[id+1];i++){
		a[i]=max(0,a[i]-tag[id]);
		if(L<=i&&i<=R)a[i]=max(0,a[i]-x);
		if(a[i]<lp[id])go[i]=i,len[i]=0;else go[i]=go[a[i]],len[i]=len[a[i]]+1,fin[id]=false;
	}
	tag[id]=0;
}
#define fa(x) max(a[x]-tag[BLK[x]],0)
int chain(int x){
	if(x==0)return dep[x]=0;
	dep[go[x]]=chain(fa(go[x]))+1;
	if(!go[x])dep[go[x]]=0;
	return dep[x]=dep[go[x]]+len[x];
}
int read(){
	int x=0;
	char c=getchar();
	while(c>'9'||c<'0')c=getchar();
	while(c>='0'&&c<='9')x=(x<<3)+(x<<1)+(c^48),c=getchar();
	return x;
}
void modify(){
	int L=read()-1,R=read()-1,x=read();
	for(int i=BLK[L];i<=BLK[R];i++)rebuild(i,L,R,x);
}
bool lab[100100];
void LCA(){
//	printf("BEF:%d\n",dep[0]);
	int x=read()-1,y=read()-1;
	chain(x),chain(y);
//	printf("AFT:%d\n",dep[0]);
	while(go[x]!=go[y]){
		if(dep[go[x]]<dep[go[y]])swap(x,y);
		x=fa(go[x]);
	}
	lab[0]=true;
	for(int i=x;i&&BLK[i]==BLK[x];i=fa(i))lab[i]=true;
	for(int i=y;BLK[i]==BLK[y];i=fa(i))if(lab[i]){printf("%d\n",i+1);break;}
	for(int i=x;i&&BLK[i]==BLK[x];i=fa(i))lab[i]=false;
}
int main(){
//	freopen("I.in","r",stdin);
	n=read(),m=read(),a[0]=-1;
	for(int i=1;i<n;i++)a[i]=read()-1,BLK[i]=i/BBB;
	lp[num=BLK[n]=BLK[n-1]+1]=n;for(int i=0;i<num;i++)lp[i]=i*BBB;
	for(int i=0;i<num;i++)rebuild(i,-1,-1,0);
	for(int i=1;i<=m;i++)if(read()==1)modify();else LCA();
	return 0;
}