Problem: You are given an undirected unweighted connected graph consisting of vertices and edges. It is guaranteed that there are no self-loops or multiple edges in the given graph.
Your task is to choose at most vertices in this graph so each unchosen vertex is adjacent (in other words, connected by an edge) to at least one of chosen vertices.
It is guaranteed that the answer exists. If there are multiple answers, you can print any.
You will be given multiple independent queries to answer.
Input Format: The first line contains a single integer () — the number of queries.
Then queries follow.
The first line of each query contains two integers and (, ) — the number of vertices and the number of edges, respectively.
The following lines denote edges: edge is represented by a pair of integers , (, ), which are the indices of vertices connected by the edge.
There are no self-loops or multiple edges in the given graph, i. e. for each pair () there are no other pairs () or () in the list of edges, and for each pair () the condition is satisfied. It is guaranteed that the given graph is connected.
It is guaranteed that over all queries.
Output Format: For each query print two lines.
In the first line print () — the number of chosen vertices.
In the second line print distinct integers in any order, where is the index of the -th chosen vertex.
It is guaranteed that the answer exists. If there are multiple answers, you can print any.
Note: In the first query any vertex or any pair of vertices will suffice.
Note that you don't have to minimize the number of chosen vertices. In the second query two vertices can be enough (vertices and ) but three is also ok.