No legend#11514

No legend

1 second
256 megabytes
Very hard

You are given a tree that has vertices, with a root of .

We assume that the immediate parent of the vertex is a_i\:(1 \le a_i < i) for (2 \le i \le n).

There are two types of queries to be executed:

Input

The first line contains two integers and q\:(2 \le n, q \le 10^5) — the number of vertices and the number of queries, respectively.

The second line contains n - 1 integers a_2, a_3, ..., a_n\:(1 \le a_i < i), where a_i is the parent of the node .

The following rows contain queries. For each query, the first integer of the string is t\:(t = 1 or query type.

If t = 1, then this is a query of the first type. Then three integers will follow: l, r, x\:(2 \le l \le r \le n, 1 \le x \le 10^5), which means that you need to replace a_i with max(a_i - x, 1) for all with l \le i \le r.

If t = 2, then this is a query of the second type. Then two integers will follow: and v\:(1 \le u, v \le n), and you should find the of and .

It is guaranteed that there is at least one query of the second type.

Output

For each query of the second type, print the answer in a new line.

Examples

Example 1

Loading
Loading