Problem: A snowflake graph is generated from two integers and , both greater than , as follows:
- Start with one central vertex.
- Connect new vertices to this central vertex.
- Connect new vertices to each of these vertices.
The snowflake graph above has a central vertex , then vertices attached to it (, , , , and ), and then vertices attached to each of those.
Input Format: The first line contains a single integer () — the number of test cases.
The first line of each test case contains two integers and (; ) — the number of vertices and edges in the graph, respectively.
The next lines each contain two integers each and (, ) — the numbers of vertices connected by an edge. The graph does not contain multiple edges and self-loops.
It is guaranteed that this graph is a snowflake graph for some integers and both greater than .
Output Format: For each test case, on a separate line output the values of and , in that order, separated by a space.
Note: The first test case is pictured in the statement. Note that the output 3 5 is incorrect, since should be output before .