#Lutece0148. H-edges

H-edges

Migrated from Lutece 148 H-edges

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

A simple graph is given with NN nodes and MM edges, each edge's length is 11. Given you the node SS, for each node VV, you should calculate the odd and even shortest distance from the node SS (VSV\neq S). (that is the shortest distance with length of odd and even, the route isn't necessarily a simple route).

We define the odd shortest distance to be odd(VV), and the even shortest distance to be even(VV). And we call the maximal one of them to be max(VV). We say a route from SS to VV whose length is max(VV) is a beautiful route (not necessarily only one), and every beautiful route's last edge is defined to be the T-edge. If there is no odd shortest route or no even shortest route for node VV, then there are no beautiful routes ended by node VV.For those edges which is not a T-edge, we say them H-edges.

Now, can you help us to find out all the H-edges.

Input

In the first line, you will get a number TT denotes the number of test cases.

For each test case,

In the first line, you will get 22 number NN (1N1000001\leq N\leq 100000) and MM (1M10000001\leq M\leq 1000000), denote the number of nodes and edges.

Then MM lines comes,

In the ithi_{th} line, 22 numbers AA and BB are given, indicate there is a road between node AA and node BB,(0A,B<N0\leq A,B < N) the symbol of this road is ii.

Then a number SS is given as described above.

Output

For each test case, you should output 22 lines.

The first line contain a number KK denotes the number of H-edges.

In the second line, you should output KK numbers denote the symbol of all the H-edges in ascending order.

Samples

1
8 8
0 1
1 2
2 3
0 4
2 5
4 5
5 6
6 7
0
2
1 4

Resources

Sichuan State Programming Contest 2008