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>
#include<cctype>
#include<algorithm>
#define For(i,l,r) for(int i=l;i<=r;++i)
using namespace std;
const int N=1e5,S=300,B=N/S+1,inf=0x3f3f3f3f;
int n,q;
int cnt,id[N+1],fro[B+1],to[B+1];
int fa[N+1],anc[N+1],tag[B+1];
void read(int &x)
{
	char c;
	x=0;
	do {
		c=getchar();
	} while(isspace(c));
	do {
		x=x*10+c-'0';
		c=getchar();
	} while(isdigit(c));
	return;
}
inline int getFa(int x)
{
	return max(fa[x]-tag[id[x]],1);
}
void calcAnc(int l,int r)
{
	For(i,l,r) {
		if(id[i]==1) {
			anc[i]=1;
		} else {
			int f=getFa(i);
			anc[i]=id[f]==id[i]?anc[f]:i;
		}
	}
	return;
}
int main()
{
	read(n),read(q);
	For(i,2,n) {
		read(fa[i]);
	}
	cnt=(n-1)/S+1;
	For(i,1,cnt) {
		fro[i]=(i-1)*S+1,to[i]=min(i*S,n);
	}
	For(i,1,n) {
		id[i]=(i-1)/S+1;
	}
	For(i,1,cnt) {
		calcAnc(fro[i],to[i]);
	}
	while(q--) {
		int opt;
		read(opt);
		if(opt==1) {
			int l,r,x;
			read(l),read(r),read(x);
			if(id[l]==id[r]) {
				For(i,l,r) {
					fa[i]=max(fa[i]-x,1);
				}
				calcAnc(l,to[id[l]]);
			} else {
				For(i,l,to[id[l]]) {
					fa[i]=max(fa[i]-x,1);
				}
				calcAnc(l,to[id[l]]);
				For(i,id[l]+1,id[r]-1) {
					tag[i]=min(tag[i]+x,inf);
					if(tag[i]-x<=S) {
						calcAnc(fro[i],to[i]);
					}
				}
				For(i,fro[id[r]],r) {
					fa[i]=max(fa[i]-x,1);
				}
				calcAnc(fro[id[r]],to[id[r]]);
			}
		} else {
			int u,v;
			read(u),read(v);
			while(anc[u]!=anc[v]) {
				if(anc[u]>anc[v]) {
					swap(u,v);
				}
				v=getFa(anc[v]);
			}
			while(getFa(u)!=getFa(v)) {
				if(getFa(u)>getFa(v)) {
					swap(u,v);
				}
				v=getFa(v);
			}
			printf("%d\n",u==v?u:getFa(u));
		}
	}
	return 0;
}