Given a directed graph, find the number of edges such that removing these edges eliminates all cycles in the graph.
Input
The first line contains two integers, $n$ and $m$, representing the number of vertices and the number of edges, respectively.
Following this are $m$ lines, each containing two node indices $u$ and $v$ (starting from 1), representing a directed edge from $u$ to $v$.
To avoid unnecessary complications, the data does not contain self-loops or multiple edges.
Output
The first line outputs the number of edges $a$ that satisfy the requirement.
Following this are $a$ lines, each outputting the index (starting from 1) of an edge that satisfies the requirement, as given in the input. All indices must be sorted in ascending order.
Examples
Input 1
6 8 1 2 2 3 3 4 4 1 2 6 6 3 4 5 5 1
Output 1
2 1 3
Note 1
As shown in the figure, both orange edges satisfy the requirement.
Input 2
4 5 1 2 2 1 1 4 4 5 5 1
Output 2
0
Note 2
There are two cycles in the graph, which do not share any edges. Removing any edge from one cycle leaves the other cycle intact.
Constraints
All data satisfies $1 \le n \le 50\,000$, $1 \le m \le 200\,000$.
35% of the data satisfies $n \le 500$, $m \le 50\,000$.
25% of the data satisfies $n \le 500$, $m \le 1\,500$.