DreamGrid has just found an undirected simple graph with nnn vertices and no edges (that’s to say, it’s a graph with nnn isolated vertices) in his right pocket, where the vertices are numbered from 1 to nnn. Now he would like to perform qqq operations of the following two types on the graph:
1 a b – Connect the aaa-th vertex and the bbb-th vertex by an edge. It’s guaranteed that before this operation, there does not exist an edge which connects vertex aaa and bbb directly.
2 k – Find the answer for the query: What’s the minimum and maximum possible number of connected components after adding kkk new edges to the graph. Note that after adding the kkk edges, the graph must still be a simple graph, and the query does NOT modify the graph.
Please help DreamGrid find the answer for each operation of the second type. Recall that a simple graph is a graph with no self loops or multiple edges.
Input
There are multiple test cases. The first line of the input is an integer TTT, indicating the number of test cases. For each test case:
The first line contains two integers nnn and qqq (1≤n≤1051 \le n \le 10^51≤n≤105, 1≤q≤2×1051 \le q \le 2 \times 10^51≤q≤2×105), indicating the number of vertices and the number of operations.
For the following qqq lines, the iii-th line first contains an integer pip_ipi (pi∈{1,2}p_i \in \{1, 2\}pi∈{1,2}), indicating the type of the iii-th operation.
If pi=1p_i = 1pi=1, two integers aia_iai and bib_ibi follow (1≤ai,bi≤n1 \le a_i, b_i \le n1≤ai,bi≤n, ai≠bia_i \ne b_iai=bi), indicating an operation of the first type. It’s guaranteed that before this operation, there does not exist an edge which connects vertex aaa and bbb directly.
If pi=2p_i = 2pi=2, one integer kik_iki follows (0≤ki≤n(n−1)20 \le k_i \le \frac{n(n-1)}{2}0≤ki≤2n(n−1)), indicating an operation of the second type. It’s guaranteed that after adding kik_iki edges to the graph, the graph is still possible to be a simple graph.
It’s guaranteed that the sum of nnn in all test cases will not exceed 10610^6106, and the sum of qqq in all test cases will not exceed 2×1062 \times 10^62×106.
Output
For each operation of the second type output one line containing two integers separated by a space, indicating the minimum and maximum possible number of connected components in this query.
Sample Input
1
5 5
1 1 2
2 1
1 1 3
2 1
2 3
Sample Output
3 3
2 3
1 2