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>
#include<cstdio>
#define lli long long
const int N=1e5+5,K=320;
int n,q,k[N];lli f[N],g[N],t[K];
inline lli mx(lli x,lli y){return x>y?x:y;}
inline int F(int x){return x==1?0:mx(f[x]-t[k[x]],1);}
inline int G(int x){return k[x]==1?0:mx(g[x]-t[k[x]],1);}
inline void cg(int x)
{
	for(int i=x*K-K+1,y;k[i]==x;++i)
		y=F(i),g[i]=(k[y]!=k[i]?y:G(y))+t[k[i]];
}
inline int lca(int x,int y)
{
	for(;G(x)!=G(y);G(x)<G(y)?y=G(y):x=G(x));
	for(;F(x)!=F(y);F(x)<F(y)?y=F(y):x=F(x));
	return x==y?x:F(x);
}
int main()
{
	scanf("%d%d",&n,&q);
	for(int i=1;i<=n;++i)k[i]=(i-1)/K+1;
	for(int i=2;i<=n;++i)scanf("%lld",&f[i]),g[i]=k[f[i]]!=k[i]?f[i]:g[f[i]];
	for(int i=1,o,x,y,z;i<=q;++i)
	{
		scanf("%d%d%d",&o,&x,&y);if(o==2){printf("%d\n",lca(x,y));continue;}scanf("%d",&z);
		if(k[x]==k[y]){for(int j=x;j<=y;++j)f[j]-=z;cg(k[x]);continue;}
		for(int j=x;k[j]==k[x];++j)f[j]-=z;cg(k[x]);
		for(int j=k[x]+1;j<k[y];++j)
		{if(t[j]<=K)t[j]+=z,cg(j);else t[j]+=z;}
		for(int j=y;k[j]==k[y];--j)f[j]-=z;cg(k[y]);
	}
	return 0;
}
   		   					  	        		 	 		