U517659 「Cfz Round 5」ˈplɑːntɪŋ triːz (English)
题目背景
[Chinese Statement](https://www.luogu.com.cn/problem/P11488). **You must submit your code at the Chinese version of the statement.**
---
> I want to plant a banana tree with all my blessings hanging on it
题目描述
Caca enjoys planting trees. He has planted a banana tree, but it seems only to grow with some artificial maintenance. So he will sometimes hang a *blessing* onto it. The so-called *blessing* is nothing but a chain. However, sometimes the tree is growing too well, leading the tree to become crooked. He has to do some pruning at times as well.
Caca loves mode, so he frequently inquires about the maximum occurrence of a certain value in the multiset formed by the depths of all existing nodes on the tree.
To be specific, there is a rooted tree. Initially, it contains the only node labeled $1$ as the root. There is a variable $n = 1$. There will be three types of operations as follows:
1. `x l k`: Attach $k$ chains, each of length $l$, under the node $x$. Formally, nodes labeled $(n + 1) \sim (n + lk)$ will be added, and for each $1 \leq i \leq k$, edge $(x, n + (i - 1)l + 1)$, as well as for each $2 \leq j \leq k$, edges $(n + (i - 1)l + j - 1, n + (i - 1)l + j)$, will be added. Afterwards, set $n \gets n + lk$.
2. `x`: Prune all the nodes in the subtree of $x$.
3. (No parameters): Inquiring about the maximum occurrence of a certain value in the multiset formed by the depths of all existing nodes on the tree.
Caca will perform $m$ operations in a row. For each operation of type $3$, please tell him the correct answer.
输入格式
无
输出格式
无
说明/提示
#### Sample Explanation #1
In the following images, the color of the nodes represents the time they were added.

The above image shows the tree after three $1 $ operations ( `1 1 2 3`, `1 6 2 2`, and `1 7 1 4` ).

The above image shows the tree that has undergone two $2$ operations ( `2 12` and `2 13` ) based on the previous one.

The above image shows the tree that has undergone another $1$ operation ( `1 3 1 2` ) based on the previous one.

The above image shows the tree after two additional $2$ operations ( `2 7` and `2 3` ) based on the previous one.

The above image shows the tree that has undergone another $1$ operation ( `1 5 2 3` ) based on the previous one.

The above image shows the tree after all operations have been performed.
#### Constraints
For all test cases, it is guaranteed that:
- $1\le m\le 10^5$;
- The $x$ in the $1$ operation satisfies $1 \le x \le n$ and the $x$ node still exists on the tree, guaranteeing that $1 \le l, k \le 10^{18}$;
- The $x$ in the $2$ operation satisfies $1 \lt x \le n$ and the $x$ node still exists on the tree;
- At any given moment, $n$ satisfies $n \le 10 ^ {18}$.
**Subtasks are used in this task.**
- Subtask 0 (10 points): $k \le 5000$.
- Subtask 1 (20 points): $k \le 5 \times 10^5$.
- Subtask 2 (20 points): There is no $2$ operation.
- Subtask 3 (20 points): The value of $l$ in the $1$ operation is $1$.
- Subtask 4 (30 points): No further restrictions.