You are given a graph of $$$n$$$ vertices labeled from $$$1$$$ to $$$n$$$, initially with no edges. You need to process $$$q$$$ queries of the following types:
After each query, output the number of pairs of integers $$$(x,y)$$$ such that $$$1 \le x \lt y \le n$$$ and there exists a path from vertex $$$x$$$ to vertex $$$y$$$. A path from vertex $$$x$$$ to vertex $$$y$$$ is defined as a sequence of integers $$$p_1,p_2,\ldots,p_m$$$ such that $$$p_1=x$$$, $$$p_m=y$$$, and there exists an undirected edge between vertices $$$p_i$$$ and $$$p_{i+1}$$$ for all $$$1 \le i \lt m$$$.
Note that you must solve this problem in online mode. That is, you can only read the current query after outputting the answer for the previous one. Also, remember to flush the output after each query. To do this, use:
The first line of each test contains two integers $$$n$$$ and $$$q$$$ ($$$2 \le n \le 10^9$$$, $$$1 \le q \le 2 \cdot 10^5$$$) — the number of vertices and queries respectively.
Each of the next $$$q$$$ lines describes a query. If the line starts with the integer $$$1$$$, it is followed by two integers $$$u$$$ and $$$v$$$ ($$$1 \le u,v \le n$$$, $$$u \ne v$$$); if the line starts with the integer $$$2$$$, it is followed by two integers $$$l$$$ and $$$r$$$ ($$$1 \le l \lt r \le n$$$).
After each query, output the number of pairs of integers $$$(x,y)$$$ such that $$$1 \le x \lt y \le n$$$ and there exists a path from vertex $$$x$$$ to vertex $$$y$$$.
6 31 1 52 2 41 1 6
1 4 6