Papyrus was being a little silly and fell off a rental scooter at full speed. Poor Papyrus got split up into $$$n$$$ bone fragments. Over time, the fragments fuse with each other. Two fragments are healed if one can be reached from another using a sequence of fused pairs.
Sans, Papyrus's brother, wants to perform some data analysis. He has a list of $$$m$$$ events, numbered $$$1$$$ to $$$m$$$ in chronological order. The $$$i$$$-th event has one of the following forms:
Help him answer every query.
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$2 \le n \le 2 \cdot 10^5$$$, $$$1 \le m \le 2 \cdot 10^5$$$) — the number of fragments and the number of events, respectively.
The next $$$m$$$ lines describe the events in chronological order. Each line has one of the following forms:
A fusion may involve fragments that are already healed.
For each event of type $$$2$$$, in order, print its answer on its own line.
3 42 1 21 1 22 1 22 2 1
-1 2 2
4 61 1 21 3 42 1 41 2 32 1 42 4 1
-1 4 4
In the first example, fragments $$$1$$$ and $$$2$$$ are not healed when the first query is asked. They fuse in event $$$2$$$, so both later queries have answer $$$2$$$.
In the second example, events $$$1$$$ and $$$2$$$ create two separate groups: fragments $$$1,2$$$ and fragments $$$3,4$$$. Fragments $$$1$$$ and $$$4$$$ are still not healed at the first query. Event $$$4$$$ connects the groups, so both later queries have answer $$$4$$$.
| Название |
|---|


