Connectivity Components - 2#4816

Connectivity Components - 2

1 second
64 megabytes
Easy

An undirected, unweighted graph is provided.

Your task is to determine the number of connected components in the graph and list them.

Input

The input consists of two integers, and (0 < N \leq 100000, 0 \leq M \leq 100000). The next lines each contain two integers, and (1 \leq i, j \leq N), indicating that there is an edge between vertices and .

Output

On the first line of the output, print the number of connected components. For each connected component, print two lines: the first line should contain the number of vertices in that component, and the second line should list the vertices in any order.

Examples

Example 1

Loading
Loading