eolymp
bolt
Try our new interface for solving problems
Problems

Bridges

Bridges

Time limit 1 second
Memory limit 128 MiB

The undirected graph is given. Find all its bridges.

Input data

The first line contains two positive integers n and m (n20000, m200000) - the number of vertices and edges in a graph respectively. Each of the next m lines contains the description of one edge. The edge number i is described with two positive integers b[i], e[i] (1b[i], e[i]n) - the numbers of the vertices it connects.

Output data

Print in the first line the number b of bridges in a given graph. Print on the next line b integers - the edge numbers that are bridges, in increasing order. The edges are numbered from one in the order they are given at the input.

prb1943.gif

Examples

Input example #1
6 7
1 2
2 3
3 4
1 3
4 5
4 6
5 6
Output example #1
1
3
Author Vitaly Goldstein
Source Winter School, Kharkov, 2011, Day 9