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 <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define per(i, a, b) for (int i = a; i >= b; i--)
using namespace std;

typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef long long ll;

template <typename T>
inline void read(T &f) {
    f = 0; T fu = 1; char c = getchar();
    while (c < '0' || c > '9') { if (c == '-') { fu = -1; } c = getchar(); }
    while (c >= '0' && c <= '9') { f = (f << 3) + (f << 1) + (c & 15); c = getchar(); }
    f *= fu;
}

template <typename T>
void print(T x) {
    if (x < 0) putchar('-'), x = -x;
    if (x < 10) putchar(x + 48);
    else print(x / 10), putchar(x % 10 + 48);
}

template <typename T>
void print(T x, char t) {
    print(x); putchar(t);
}

const int N = 1e5 + 5, B = 350;

int a[N], tag[B], go[N];
int n, m;

void rebuild(int blk) {
    int l = (blk - 1) * B + 2, r = min(n, blk * B + 1);
    for (int i = l; i <= r; i++) {
        int to = max(a[i] - tag[blk], 1);
        if (to < l) go[i] = to;
        else go[i] = go[to];
    }
}

inline int getnxt(int pos) {
    int b = (pos - 2) / B + 1;
    if (tag[b] < B) return go[pos];
    return max(a[pos] - tag[b], 1);
}

int main() {
    read(n); read(m);
    for (int i = 2; i <= n; i++) read(a[i]);
    for (int i = 1; i <= (n - 2) / B + 1; i++) rebuild(i);
    while (m--) {
        int opt; read(opt);
        if (opt == 1) {
            int l, r, x;
            read(l); read(r); read(x);
            int bl = (l - 2) / B + 1, br = (r - 2) / B + 1;
            if (bl == br) {
                for (int j = l; j <= r; j++) a[j] = max(a[j] - x, 1);
                rebuild(bl);
            } else {
                for (int j = l; j <= bl * B + 1; j++) a[j] = max(a[j] - x, 1);
                for (int j = (br - 1) * B + 2; j <= r; j++) a[j] = max(a[j] - x, 1);
                rebuild(bl); rebuild(br);
                for (int j = bl + 1; j <= br - 1; j++) {
                    tag[j] = min(tag[j] + x, N);
                    if (tag[j] < B) rebuild(j);
                }
            }
        }
        if (opt == 2) {
            int u, v, preu, prev;
            read(u); read(v); preu = u; prev = v;
            while (u != v) {
                if (u < v) swap(u, v), swap(preu, prev);
                preu = u; u = getnxt(u);
            }
            while (preu != prev) {
                if (preu < prev) swap(preu, prev);
                int b = (preu - 2) / B + 1;
                preu = max(a[preu] - tag[b], 1);
            }
            print(preu, '\n');
        }
    }
    return 0;
}