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 LL long long
#define LD long double
using namespace std;
const LL P=998244353;
const int N=3e5+10;
const int INF=1e9;
int read(){
    int x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
void print(LL x){
    if(x>9) print(x/10);
    putchar(x%10+'0');
}
void pls(LL &x,LL y){
    x+=y;if(x>=P)x-=P;
}
const int E=320;
int n,Q;
int a[N],g[N],tag[N],mx[N],b[N];
void init(int i){
	int L=(i-1)*E+1,R=min(n,i*E);
	mx[i]=0;
	for(int j=L;j<=R;++j){
		if(a[j]>mx[i]) mx[i]=a[j];
    	if(a[j]<L) b[j]=j;
    	else b[j]=b[a[j]];
	}
}
void MAIN(){
	int L,R;
    n=read();Q=read();
    for(int i=2;i<=n;++i) a[i]=read();
    a[1]=1;
    for(int i=1;i<=n;++i) g[i]=(i+E-1)/E;
    for(int i=1;i<=g[n];++i) {
    	tag[i]=0;
    	init(i);
	}
    int op,l,r,x;
    while(Q--){
    	op=read();l=read();r=read();
    	if(op==1){
    		x=read();
    		if(g[l]==g[r]){
    			for(int i=l;i<=r;++i){
    				a[i]=max(a[i]-x,1);
				}
				if(mx[g[l]]>(g[l]-1)*E) init(g[l]);
			}
			else{
				for(int i=l;i<=g[l]*E;++i){
					a[i]=max(a[i]-x,1);
				}
				if(mx[g[l]]>(g[l]-1)*E) init(g[l]);
				
				for(int i=(g[r]-1)*E+1;i<=r;++i){
					a[i]=max(a[i]-x,1);
				}
				if(mx[g[r]]>(g[r]-1)*E) init(g[r]);
				
				for(int i=g[l]+1;i<g[r];++i){
					if(mx[i]<(i-1)*E) tag[i]+=x;
					else{
						for(int j=(i-1)*E+1;j<=i*E;++j){
							a[j]=max(a[j]-x,1);
						}
						init(i);
					}
				}
			}
		}
		else{
			while(1){
				if(l==r) break;
				if(l>r) swap(l,r);
				if(g[l]!=g[r]){
					r=max(a[b[r]]-tag[g[r]],1);
					continue;
				}
				if(b[l]!=b[r]){
					l=max(a[b[l]]-tag[g[l]],1);
					r=max(a[b[r]]-tag[g[r]],1);
					continue;
				}
				r=max(a[r]-tag[g[r]],1);
			}
			printf("%d\n",l);
		}
	}
	return;
}

int main(){
    int ttt=1;
    while(ttt--) MAIN();
    return 0;
}