Components of edge biconnectivity
In graph theory, a component of edge connectivity of a graph is defined as the largest subset of vertices such that for any two distinct vertices , there exist at least two edge-disjoint paths between and .
Given an undirected graph, your task is to determine its components of edge connectivity.
Input
The first line of the input contains two integers and — the number of vertices and edges in the graph, respectively . The next lines each describe an edge with two integers — the vertices connected by the edge .
Output
On the first line of the output, print the integer — the number of edge connectivity components in the graph. On the second line, print integers , each not exceeding , where indicates the edge connectivity component to which the -th vertex belongs.