Let G=(V,E) be a connected undirected graph.
A set of vertices S is called a dominating set if every vertex v∈V either belongs to S, or has a neighbor in S.
A vertex v is called a leaf if it has exactly one neighbor.
Graph G satisfies the following property: every vertex has at most two neighboring leaves.
Find a set S⊂V such that:
It is guaranteed that such a set always exists.
Each test contains multiple test cases. The first line contains the number of test cases t (1≤t≤104). The description of the test cases follows.
The first line of each test case contains two integers n and m, denoting the number of vertices and the number of edges in G (2≤n≤2⋅105; 1≤m≤5⋅105).
Each of the next m lines contains two integers x_i and y_i, denoting the endpoints of the i-th edge (1≤x_i,y_i≤n; x_i=y_i). The graph does not contain loops or multiple edges. Every vertex has at most two neighboring leaves.
It is guaranteed that the sum of n over all test cases does not exceed 2⋅105, and the sum of m over all test cases does not exceed 5⋅105.
Print ⌊2n⌋ distinct integers s_1,s_2,…,s_⌊n/2⌋, denoting the vertices belonging to S in any order (1≤s_i≤n).
If there are multiple solutions, print any of them.