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>
/*long long or int&the MAX_INT or MIN_INT*/
/*the size of a[]&inline*/
/*xx 396*/
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
using namespace std;
typedef long long ll;
typedef double db;
typedef long double ldb;
template<class T>inline void checkmin(T &a,const T &b){if(b<a)a=b;}
template<class T>inline void checkmax(T &a,const T &b){if(b>a)a=b;}
const int maxn=1e5+1000;
int n,s=0,m;
int a[maxn],f[maxn],lz[maxn],cnt[maxn];
int get_l(int i){return i*s;}
int get_r(int i){return (i+1)*s-1;}
int get_x(int i){return i/s;}
void construct(int x){
//	cout<<x<<endl;
	int l=get_l(x),r=get_r(x);
//	cout<<l<<" "<<r<<" "<<lz[x]<<endl;
//	for(int i=l;i<=r;i++)cout<<a[i]<<" ";cout<<endl;
	for(int i=l;i<=r;i++)a[i]=max(0,a[i]-lz[x]);lz[x]=0;
//	for(int i=l;i<=r;i++)cout<<a[i]<<" ";cout<<endl;
	for(int i=l;i<=r;i++)f[i]=a[i]<l?a[i]:f[a[i]];
/*	for(int i=l;i<=r;i++){
		cout<<a[i]<<" "<<f[i]<<" "<<l<<endl;
	}
*/
}
void update(int l,int r,int del){
	int lx=get_x(l),rx=get_x(r);
	if(lx==rx){
		for(int i=l;i<=r;i++)a[i]=max(0,a[i]-del);
		construct(lx);return;
	}
	for(int i=l;i<=get_r(lx);i++)a[i]=max(0,a[i]-del);construct(lx);
	for(int i=get_l(rx);i<=r;i++)a[i]=max(0,a[i]-del);construct(rx);
	for(int i=lx+1;i<rx;i++){
		cnt[i]++;lz[i]=min(n,lz[i]+del);
		if(cnt[i]<=s)construct(i);
	}
}
int get_f(int i){return max(0,f[i]-lz[get_x(i)]);}
int get_a(int i){return max(0,a[i]-lz[get_x(i)]);}
int query(int u,int v){
	while(u!=v){
		if(get_x(u)<get_x(v))swap(u,v);
		if(get_x(u)>get_x(v))u=get_f(u);
		else{
			if(get_f(u)!=get_f(v))u=get_f(u),v=get_f(v);
			else{
				while(u!=v){
					if(u<v)swap(u,v);
					u=get_a(u);
				}
			}
		}
	}
	return u;
}
int main(){
	memset(a,-1,sizeof(a));memset(f,-1,sizeof(f));
	scanf("%d%d",&n,&m);
	while(s*s<=n)s++;
	for(int i=1;i<n;i++)scanf("%d",&a[i]),a[i]--;
	for(int i=0;i<=get_x(n);i++)construct(i);
//	for(int i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
	while(m--){
		int t;scanf("%d",&t);
		if(t==1){
			int l,r,x;scanf("%d%d%d",&l,&r,&x);l--;r--;
			update(l,r,x);
		}
		else{
			int u,v;scanf("%d%d",&u,&v);u--;v--;
			printf("%d\n",query(u,v)+1);
		}
	//	for(int i=0;i<n;i++)cout<<a[i]<<" ";cout<<endl;
	}
	return 0;
}