Given a directed graph with $N$ vertices and $M$ edges. The $i$-th edge is $(a_i, b_i)$. This graph may not be simple.
Decompose this graph into SCCs and print them in topological order.
Constraints
- $1 \leq N \leq 500,000$
- $1 \leq M \leq 500,000$
- $0 \leq a_i, b_i < N$
Input
$N$ $M$ $a_0$ $b_0$ $a_1$ $b_1$ : $a_{M - 1}$ $b_{M - 1}$
Output
The first line contains the number of SCCs $K$. The following $K$ lines contain the information for each SCC. $l$ is the number of vertices in the SCC, and $v_i$ are the vertex indices.
$l$ $v_0$ $v_1$ ... $v_{l-1}$
For each edge $(a_i, b_i)$, the line containing $b_i$ must not appear before the line containing $a_i$.
If there are multiple solutions, you may print any of them.
Examples
Input 1
6 7 1 4 5 2 3 0 5 5 4 1 0 3 4 2
Output 1
4 1 5 2 4 1 1 2 2 3 0