CF1491H Yuezheng Ling and Dynamic Tree

Description

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 \leq a_i

Input Format

N/A

Output Format

N/A

Explanation/Hint

The tree in example is shown below. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1491H/818163092787871fe6b5fd7889d250d0fa5e8087.png)After the query of the first type, the tree changes and is looking as shown below. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF1491H/c2a6cdaaa81fc0062a546706c09a18121fedd155.png)